Versions in this module Expand all Collapse all v2 v2.9.3 Mar 12, 2021 v2.9.2 Mar 12, 2021 Changes in this version + var DefaultAddress = ":0" + var DefaultCodecs = map[string]codec.NewCodec + var DefaultContentType = "application/protobuf" + var DefaultId = uuid.New().String() + var DefaultName = "go.micro.server" + var DefaultRegisterCheck = func(context.Context) error + var DefaultRegisterInterval = time.Second * 30 + var DefaultRegisterTTL = time.Second * 90 + var DefaultRouter = newRpcRouter() + var DefaultServer Server = newRpcServer() + var DefaultVersion = "latest" + var NewServer func(...Option) Server = newRpcServer + func Handle(h Handler) error + func Init(opt ...Option) + func NewContext(ctx context.Context, s Server) context.Context + func NewRouter() *router + func Run() error + func Start() error + func Stop() error + func String() string + func Subscribe(s Subscriber) error + type Handler interface + Endpoints func() []*registry.Endpoint + Handler func() interface{} + Name func() string + Options func() HandlerOptions + func NewHandler(h interface{}, opts ...HandlerOption) Handler + type HandlerFunc func(ctx context.Context, req Request, rsp interface{}) error + type HandlerOption func(*HandlerOptions) + func EndpointMetadata(name string, md map[string]string) HandlerOption + func InternalHandler(b bool) HandlerOption + type HandlerOptions struct + Internal bool + Metadata map[string]map[string]string + type HandlerWrapper func(HandlerFunc) HandlerFunc + type Message interface + Body func() []byte + Codec func() codec.Reader + ContentType func() string + Header func() map[string]string + Payload func() interface{} + Topic func() string + type Option func(*Options) + func Address(a string) Option + func Advertise(a string) Option + func Auth(a auth.Auth) Option + func Broker(b broker.Broker) Option + func Codec(contentType string, c codec.NewCodec) Option + func Context(ctx context.Context) Option + func Id(id string) Option + func Metadata(md map[string]string) Option + func Name(n string) Option + func RegisterCheck(fn func(context.Context) error) Option + func RegisterInterval(t time.Duration) Option + func RegisterTTL(t time.Duration) Option + func Registry(r registry.Registry) Option + func TLSConfig(t *tls.Config) Option + func Tracer(t trace.Tracer) Option + func Transport(t transport.Transport) Option + func Version(v string) Option + func Wait(wg *sync.WaitGroup) Option + func WithRouter(r Router) Option + func WrapHandler(w HandlerWrapper) Option + func WrapSubscriber(w SubscriberWrapper) Option + type Options struct + Address string + Advertise string + Auth auth.Auth + Broker broker.Broker + Codecs map[string]codec.NewCodec + Context context.Context + HdlrWrappers []HandlerWrapper + Id string + Metadata map[string]string + Name string + RegisterCheck func(context.Context) error + RegisterInterval time.Duration + RegisterTTL time.Duration + Registry registry.Registry + Router Router + SubWrappers []SubscriberWrapper + TLSConfig *tls.Config + Tracer trace.Tracer + Transport transport.Transport + Version string + func DefaultOptions() Options + type Request interface + Body func() interface{} + Codec func() codec.Reader + ContentType func() string + Endpoint func() string + Header func() map[string]string + Method func() string + Read func() ([]byte, error) + Service func() string + Stream func() bool + type Response interface + Codec func() codec.Writer + Write func([]byte) error + WriteHeader func(map[string]string) + type Router interface + ProcessMessage func(context.Context, Message) error + ServeRequest func(context.Context, Request, Response) error + type Server interface + Handle func(Handler) error + Init func(...Option) error + NewHandler func(interface{}, ...HandlerOption) Handler + NewSubscriber func(string, interface{}, ...SubscriberOption) Subscriber + Options func() Options + Start func() error + Stop func() error + String func() string + Subscribe func(Subscriber) error + func FromContext(ctx context.Context) (Server, bool) + type Stream interface + Close func() error + Context func() context.Context + Error func() error + Recv func(interface{}) error + Request func() Request + Send func(interface{}) error + type StreamWrapper func(Stream) Stream + type Subscriber interface + Endpoints func() []*registry.Endpoint + Options func() SubscriberOptions + Subscriber func() interface{} + Topic func() string + func NewSubscriber(topic string, h interface{}, opts ...SubscriberOption) Subscriber + type SubscriberFunc func(ctx context.Context, msg Message) error + type SubscriberOption func(*SubscriberOptions) + func DisableAutoAck() SubscriberOption + func InternalSubscriber(b bool) SubscriberOption + func SubscriberContext(ctx context.Context) SubscriberOption + func SubscriberQueue(n string) SubscriberOption + type SubscriberOptions struct + AutoAck bool + Context context.Context + Internal bool + Queue string + func NewSubscriberOptions(opts ...SubscriberOption) SubscriberOptions + type SubscriberWrapper func(SubscriberFunc) SubscriberFunc Other modules containing this package github.com/btccom/go-micro