Versions in this module Expand all Collapse all v0 v0.5.5 Feb 24, 2022 Changes in this version + const DefaultAddress + var ErrFunctionNotFound = fmt.Errorf("function not found") + func GetTwinID(ctx context.Context) uint32 + func LoggerMiddleware(ctx context.Context, payload []byte) (context.Context, error) + type Client interface + Call func(ctx context.Context, twin uint32, fn string, data interface{}, ...) error + func Default() (Client, error) + func NewClient(address string, poolSize ...uint32) (Client, error) + type Handler func(ctx context.Context, payload []byte) (interface{}, error) + type Message struct + Command string + Data string + Epoch int64 + Err string + Expiration int + Proxy bool + Retqueue string + Retry int + Schema string + TwinDest []uint32 + TwinSrc uint32 + UID string + Version int + func GetMessage(ctx context.Context) Message + func (m *Message) GetPayload() ([]byte, error) + type MessageBus struct + func New(address string) (*MessageBus, error) + func (m *MessageBus) Handlers() []string + func (m *MessageBus) Run(ctx context.Context) error + func (m *MessageBus) Subroute(prefix string) Router + func (m *MessageBus) Use(mw Middleware) + func (m *MessageBus) WithHandler(topic string, handler Handler) + type Middleware func(ctx context.Context, payload []byte) (context.Context, error) + type Router interface + Subroute func(route string) Router + Use func(Middleware) + WithHandler func(route string, handler Handler)