Skip to content

Commit 03782bc

Browse files
authored
move service to service dir to make life not suck (#2753)
1 parent 1040b7c commit 03782bc

File tree

4 files changed

+399
-354
lines changed

4 files changed

+399
-354
lines changed

micro.go

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66

77
"go-micro.dev/v5/client"
88
"go-micro.dev/v5/server"
9+
"go-micro.dev/v5/service"
910
)
1011

1112
type serviceKey struct{}
@@ -32,6 +33,10 @@ type Service interface {
3233
String() string
3334
}
3435

36+
type Option = service.Option
37+
38+
type Options = service.Options
39+
3540
// Event is used to publish messages to a topic.
3641
type Event interface {
3742
// Publish publishes a message to the event topic
@@ -41,18 +46,16 @@ type Event interface {
4146
// Type alias to satisfy the deprecation.
4247
type Publisher = Event
4348

44-
type Option func(*Options)
45-
4649
// New represents the new service
4750
func New(name string) Service {
48-
return newService(
49-
Name(name),
51+
return NewService(
52+
service.Name(name),
5053
)
5154
}
5255

5356
// NewService creates and returns a new Service based on the packages within.
5457
func NewService(opts ...Option) Service {
55-
return newService(opts...)
58+
return service.New(opts...)
5659
}
5760

5861
// FromContext retrieves a Service from the Context.

0 commit comments

Comments
 (0)