Преглед изворни кода

frames for manage.go

secure
kimsungho пре 4 година
родитељ
комит
f70df938fa
2 измењених фајлова са 30 додато и 5 уклоњено
  1. 19
    0
      modules/manage.go
  2. 11
    5
      modules/message.go

+ 19
- 0
modules/manage.go Прегледај датотеку

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 Прегледај датотеку

2
 
2
 
3
 //*****메세지 틀*****
3
 //*****메세지 틀*****
4
 type Message struct {
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
 type MsgUnit interface {
12
 type MsgUnit interface {
24
 
24
 
25
 //KeyGen 명령 메세지
25
 //KeyGen 명령 메세지
26
 type KeyGenMsg struct {
26
 type KeyGenMsg struct {
27
+	Message
27
 }
28
 }
28
 
29
 
29
 //Key공유 메세지
30
 //Key공유 메세지
30
 type KeyShareMsg struct {
31
 type KeyShareMsg struct {
32
+	Message
31
 }
33
 }
32
 
34
 
33
 //전달할 내용을 담은 메세지
35
 //전달할 내용을 담은 메세지
34
 type PublishMsg struct {
36
 type PublishMsg struct {
37
+	Message
35
 }
38
 }
36
 
39
 
37
 //구독 정보를 담은 메세지
40
 //구독 정보를 담은 메세지
38
 type SubscriptionMsg struct {
41
 type SubscriptionMsg struct {
42
+	Message
39
 }
43
 }
40
 
44
 
41
 //Microservice 등록 메세지
45
 //Microservice 등록 메세지
42
 type RegisterMsg struct {
46
 type RegisterMsg struct {
47
+	Message
43
 }
48
 }
44
 
49
 
45
 //Microservice 탈퇴 메세지
50
 //Microservice 탈퇴 메세지
46
 type WithdrawMsg struct {
51
 type WithdrawMsg struct {
52
+	Message
47
 }
53
 }
48
 
54
 
49
 //**************************
55
 //**************************

Loading…
Откажи
Сачувај