Versions in this module Expand all Collapse all v0 v0.3.2 Nov 9, 2018 Changes in this version + var DefaultAddress = ":0" + var DefaultId = uuid.NewUUID().String() + var DefaultName = "go-server" + var DefaultServer Server = newRpcServer() + var DefaultVersion = "1.0.0" + func Deregister() error + func Handle(h Handler) error + func Init(opt ...Option) + func NewContext(ctx context.Context, s Server) context.Context + func Register() error + func Run() error + func Start() error + func Stop() error + func String() string + func Subscribe(s Subscriber) error + type Debug struct + 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 + ContentType func() string + Payload func() interface{} + Topic func() string + type Option func(*Options) + func Address(a string) Option + func Advertise(a string) Option + func Broker(b broker.Broker) Option + func Codec(contentType string, c codec.NewCodec) Option + func DebugHandler(d debug.DebugHandler) Option + func Id(id string) Option + func Metadata(md map[string]string) Option + func Name(n string) Option + func RegisterTTL(t time.Duration) Option + func Registry(r registry.Registry) Option + func Transport(t transport.Transport) Option + func Version(v string) Option + func Wait(b bool) Option + func WrapHandler(w HandlerWrapper) Option + func WrapSubscriber(w SubscriberWrapper) Option + type Options struct + Address string + Advertise string + Broker broker.Broker + Codecs map[string]codec.NewCodec + Context context.Context + DebugHandler debug.DebugHandler + HdlrWrappers []HandlerWrapper + Id string + Metadata map[string]string + Name string + RegisterTTL time.Duration + Registry registry.Registry + SubWrappers []SubscriberWrapper + Transport transport.Transport + Version string + func DefaultOptions() Options + type Request interface + ContentType func() string + Method func() string + Request func() interface{} + Service func() string + Stream func() bool + type Server interface + Deregister func() error + Handle func(Handler) error + Init func(...Option) error + NewHandler func(interface{}, ...HandlerOption) Handler + NewSubscriber func(string, interface{}, ...SubscriberOption) Subscriber + Options func() Options + Register func() error + Start func() error + Stop func() error + String func() string + Subscribe func(Subscriber) error + func FromContext(ctx context.Context) (Server, bool) + func NewServer(opt ...Option) Server + 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 InternalSubscriber(b bool) SubscriberOption + func SubscriberQueue(n string) SubscriberOption + type SubscriberOptions struct + Internal bool + Queue string + type SubscriberWrapper func(SubscriberFunc) SubscriberFunc