Versions in this module Expand all Collapse all v2 v2.9.3 Mar 19, 2021 Changes in this version + var HeaderPrefix = "Micro-" + func NewContext(ctx context.Context, s Service) context.Context + func RegisterHandler(s server.Server, h interface{}, opts ...server.HandlerOption) error + func RegisterSubscriber(topic string, s server.Server, h interface{}, opts ...server.SubscriberOption) error + type Event interface + Publish func(ctx context.Context, msg interface{}, opts ...client.PublishOption) error + func NewEvent(topic string, c client.Client) Event + func NewPublisher(topic string, c client.Client) Event + type Function interface + Done func() error + Handle func(v interface{}) error + Subscribe func(topic string, v interface{}) error + func NewFunction(opts ...Option) Function + type Option func(*Options) + func Action(a func(*cli.Context) error) Option + func Address(addr string) Option + func AfterStart(fn func() error) Option + func AfterStop(fn func() error) Option + func Auth(a auth.Auth) Option + func BeforeStart(fn func() error) Option + func BeforeStop(fn func() error) Option + func Broker(b broker.Broker) Option + func Client(c client.Client) Option + func Cmd(c cmd.Cmd) Option + func Config(c config.Config) Option + func Context(ctx context.Context) Option + func Flags(flags ...cli.Flag) Option + func HandleSignal(b bool) Option + func Metadata(md map[string]string) Option + func Name(n string) Option + func Profile(p profile.Profile) Option + func RegisterInterval(t time.Duration) Option + func RegisterTTL(t time.Duration) Option + func Registry(r registry.Registry) Option + func Runtime(r runtime.Runtime) Option + func Selector(s selector.Selector) Option + func Server(s server.Server) Option + func Store(s store.Store) Option + func Tracer(t trace.Tracer) Option + func Transport(t transport.Transport) Option + func Version(v string) Option + func WrapCall(w ...client.CallWrapper) Option + func WrapClient(w ...client.Wrapper) Option + func WrapHandler(w ...server.HandlerWrapper) Option + func WrapSubscriber(w ...server.SubscriberWrapper) Option + type Options struct + AfterStart []func() error + AfterStop []func() error + Auth auth.Auth + BeforeStart []func() error + BeforeStop []func() error + Broker broker.Broker + Client client.Client + Cmd cmd.Cmd + Config config.Config + Context context.Context + Profile profile.Profile + Registry registry.Registry + Runtime runtime.Runtime + Server server.Server + Signal bool + Store store.Store + Transport transport.Transport + type Publisher = Event + type Service interface + Client func() client.Client + Init func(...Option) + Name func() string + Options func() Options + Run func() error + Server func() server.Server + String func() string + func FromContext(ctx context.Context) (Service, bool) + func NewService(opts ...Option) Service Other modules containing this package gitee.com/eyimi/go-micro