File tree Expand file tree Collapse file tree 4 files changed +399
-354
lines changed Expand file tree Collapse file tree 4 files changed +399
-354
lines changed Original file line number Diff line number Diff line change 6
6
7
7
"go-micro.dev/v5/client"
8
8
"go-micro.dev/v5/server"
9
+ "go-micro.dev/v5/service"
9
10
)
10
11
11
12
type serviceKey struct {}
@@ -32,6 +33,10 @@ type Service interface {
32
33
String () string
33
34
}
34
35
36
+ type Option = service.Option
37
+
38
+ type Options = service.Options
39
+
35
40
// Event is used to publish messages to a topic.
36
41
type Event interface {
37
42
// Publish publishes a message to the event topic
@@ -41,18 +46,16 @@ type Event interface {
41
46
// Type alias to satisfy the deprecation.
42
47
type Publisher = Event
43
48
44
- type Option func (* Options )
45
-
46
49
// New represents the new service
47
50
func New (name string ) Service {
48
- return newService (
49
- Name (name ),
51
+ return NewService (
52
+ service . Name (name ),
50
53
)
51
54
}
52
55
53
56
// NewService creates and returns a new Service based on the packages within.
54
57
func NewService (opts ... Option ) Service {
55
- return newService (opts ... )
58
+ return service . New (opts ... )
56
59
}
57
60
58
61
// FromContext retrieves a Service from the Context.
You can’t perform that action at this time.
0 commit comments