Documentation ¶
Overview ¶
Package remote contains optional functionality. Interfaces and utilities will be in package remote, and implementation that depend on 3:rd party will be in sub-packages For example dependencies to event-bus implementations should not be manadatory. In case you want to use, for example NSQ,or NATS or something, then it should be easy to include the extra-package for that, and link in. If the utils in here grows too big, they will become their own repositorys.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MessageReply ¶
The reply message to recieve
func MakeReplies ¶
func MakeReplies(msgId int64, payload []byte) (ret []MessageReply)
func (*MessageReply) Encode ¶
func (mr *MessageReply) Encode() ([]byte, error)
func (*MessageReply) Info ¶
func (mr *MessageReply) Info() string
func (*MessageReply) String ¶
func (mr *MessageReply) String() string
type PubSub ¶
type PubSub interface { Pub(topic string, data []byte) error Sub(topic string, handler SubHandler) error Close() error }
Generic PubSub interface.
type ReplySegmentChannel ¶
type ReplySegmentChannel struct { Parts []MessageReply Channel chan<- *MessageReply }
func (*ReplySegmentChannel) SendIfComplete ¶
func (rsc *ReplySegmentChannel) SendIfComplete(msg *MessageReply) (ok bool)
type ReplyableMessage ¶
Simple message with some metadata for reply
func (*ReplyableMessage) Encode ¶
func (rm *ReplyableMessage) Encode() ([]byte, error)
type ReplyablePubSub ¶
type ReplyablePubSub interface { PubSub Request(string, []byte) (*MessageReply, error) }
func NewReplyablePubSub ¶
func NewReplyablePubSub(ps PubSub) (rep ReplyablePubSub, err error)
func NewReplyablePubSubWithInbox ¶
func NewReplyablePubSubWithInbox(ps PubSub, inbox string) (rep ReplyablePubSub, err error)
type RequestReplyChannel ¶
Bare function for request reply. Will be mapped 1 to 1 with a topic/endpoints.
func MakeRequestReplyChannel ¶
func MakeRequestReplyChannel(rps ReplyablePubSub, topic string) RequestReplyChannel
A wrapper to make a RequestReplyChannel. It the rpc/eventbus has native request reply, then that implementation will have its own RequestReplyChannel creator.
type StreamTopicChannel ¶
func MakeStreamTopicChannel ¶
func MakeStreamTopicChannel(ps PubSub, topic string) StreamTopicChannel
type SubHandler ¶
Generic handler for subscriptions
func MakeSubReplyHandler ¶
func MakeSubReplyHandler(ps PubSub, fn SubReplyHandlerHelperFn) SubHandler
A func to handle msg reply. Will only bee needed for pubsub's where it is not included.