1
0
mirror of https://github.com/go-micro/go-micro.git synced 2025-11-23 21:44:41 +02:00

move service to service dir to make life not suck (#2753)

This commit is contained in:
Asim Aslam
2025-05-04 19:44:56 +01:00
committed by GitHub
parent 1040b7c58e
commit 03782bc9b3
4 changed files with 399 additions and 354 deletions

View File

@@ -6,6 +6,7 @@ import (
"go-micro.dev/v5/client"
"go-micro.dev/v5/server"
"go-micro.dev/v5/service"
)
type serviceKey struct{}
@@ -32,6 +33,10 @@ type Service interface {
String() string
}
type Option = service.Option
type Options = service.Options
// Event is used to publish messages to a topic.
type Event interface {
// Publish publishes a message to the event topic
@@ -41,18 +46,16 @@ type Event interface {
// Type alias to satisfy the deprecation.
type Publisher = Event
type Option func(*Options)
// New represents the new service
func New(name string) Service {
return newService(
Name(name),
return NewService(
service.Name(name),
)
}
// NewService creates and returns a new Service based on the packages within.
func NewService(opts ...Option) Service {
return newService(opts...)
return service.New(opts...)
}
// FromContext retrieves a Service from the Context.