Parcourir la source

frames for manage.go

secure
kimsungho il y a 4 ans
Parent
révision
f70df938fa
2 fichiers modifiés avec 30 ajouts et 5 suppressions
  1. 19
    0
      modules/manage.go
  2. 11
    5
      modules/message.go

+ 19
- 0
modules/manage.go Voir le fichier

@@ -0,0 +1,19 @@
1
+package modules
2
+
3
+//각 Microservice에 대한 정보 저장 노드
4
+type MSnode struct {
5
+	nodeName string
6
+	ipAddr   string
7
+}
8
+
9
+func (node *MSnode) Getname() string {
10
+	return node.nodeName
11
+}
12
+func (node *MSnode) Getipaddr() string {
13
+	return node.ipAddr
14
+}
15
+
16
+//모든 Microservice정보 저장
17
+type MStable struct {
18
+	IpTable map[string]MSnode
19
+}

+ 11
- 5
modules/message.go Voir le fichier

@@ -2,11 +2,11 @@ package modules
2 2
 
3 3
 //*****메세지 틀*****
4 4
 type Message struct {
5
-	From    string
6
-	Version string
7
-	Time    string
8
-	Type    string
9
-	Content MsgUnit
5
+	from    string
6
+	version string
7
+	time    string
8
+	kine    string
9
+	content MsgUnit
10 10
 }
11 11
 
12 12
 type MsgUnit interface {
@@ -24,26 +24,32 @@ type MsgUnit interface {
24 24
 
25 25
 //KeyGen 명령 메세지
26 26
 type KeyGenMsg struct {
27
+	Message
27 28
 }
28 29
 
29 30
 //Key공유 메세지
30 31
 type KeyShareMsg struct {
32
+	Message
31 33
 }
32 34
 
33 35
 //전달할 내용을 담은 메세지
34 36
 type PublishMsg struct {
37
+	Message
35 38
 }
36 39
 
37 40
 //구독 정보를 담은 메세지
38 41
 type SubscriptionMsg struct {
42
+	Message
39 43
 }
40 44
 
41 45
 //Microservice 등록 메세지
42 46
 type RegisterMsg struct {
47
+	Message
43 48
 }
44 49
 
45 50
 //Microservice 탈퇴 메세지
46 51
 type WithdrawMsg struct {
52
+	Message
47 53
 }
48 54
 
49 55
 //**************************

Chargement…
Annuler
Enregistrer