-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfuse_data_test.go
113 lines (88 loc) · 1.66 KB
/
fuse_data_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
package fuse
import "fmt"
func M1() string {
return "testing"
}
type OrderController struct {
s string
OrdPtr *OrderService `_fuse:"OrdSvc"`
OrdSvc IOrderService `_fuse:"OrdSvc"`
OrdSvc2 OrderService `_fuse:"OrdSvc"`
OrderService `_fuse:"OrdSvc"`
}
func (ordCtrl *OrderController) Order(id string) error {
return nil
}
type OrderController1 struct {
s string `_fuse:"OrdSvc"`
t string
aOrdPtr *OrderService `_fuse:"OrdSvc"`
OrdPtr *OrderService `_fuse:"OrdSvc"`
OrdSvc IOrderService `_fuse:"OrdSvc"`
}
func (ordCtrl *OrderController1) Order(id string) error {
return nil
}
type OrderController2 struct {
s string
OrdPtr *OrderService `_fuse:"OrdCtrl"`
OrdSvc IOrderService `_fuse:"OrdCtrl"`
}
func (ordCtrl *OrderController2) Order(id string) error {
return nil
}
type IOrderService interface {
findOrder() string
saveOrder() string
}
type OrderService struct {
T string
Status string
}
func (o *OrderService) findOrder() string {
return o.T
}
func (o *OrderService) saveOrder() string {
o.Status = "Saved"
return "saved"
}
type IAuthService interface {
auth() bool
}
type AuthService struct {
Status string
}
func (a *AuthService) auth() bool {
a.Status = "authenticated"
return true
}
type OrderDB struct {
}
type CartService struct {
}
type Isvc1 interface {
M1()
}
type Svc1 struct {
S2 Isvc2 `_fuse:"svc2"`
S3 *Svc3 `_fuse:"svc3"`
s string
}
func (i Svc1) M1() {
fmt.Println("Inside svc1 M1")
}
type Isvc2 interface {
M2()
}
type Svc2 struct {
s string
}
func (i Svc2) M2() {
fmt.Println("Inside svc2 M2")
}
type Svc3 struct {
s string
}
func M3() {
fmt.Println("Inside svc3 M3")
}