Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrTerminateConnection = errors.New("unsupported opcode, begin connection tear down") ErrConnectionTerminated = errors.New("connection already teared down") ErrEmptyTopicSet = errors.New("topic list is empty") ErrListenerNotStarted = errors.New("failed to start listener") ErrEmptyRead = errors.New("read zero bytes from socket") ErrIllegalRead = errors.New("illegal envelope read completion event") )
Functions ¶
This section is empty.
Types ¶
type AddSubscriptionRequest ¶
AddSubscriptionRequest - After a subcriber is registered i.e. has been allocated one unique subscription id they can subscribe to more topics, that's what's being done here
func (*AddSubscriptionRequest) ReadFrom ¶
func (a *AddSubscriptionRequest) ReadFrom(r io.Reader) (int64, error)
ReadFrom - Read subscription request back from stream & constructs object
func (*AddSubscriptionRequest) WriteEnvelope ¶ added in v0.2.0
func (a *AddSubscriptionRequest) WriteEnvelope(w io.Writer) (int64, error)
WriteEnvelope - Subscriber invokes for writing message envelope so that Hub can understand `how to handle message ?`
It should write 5-bytes into stream, in ideal condition
type CountResponse ¶
type CountResponse uint32
CountResponse - Lets publisher/ subscriber know of some sort of count which has context specific meaning like `how many topics were successfully subscribed to ?` or `how many subscribers received message ?`
type Msg ¶
Publisher to send message in this form
func (*Msg) WriteEnvelope ¶ added in v0.2.0
WriteEnvelope - Publisher invokes for writing message envelope so that Hub can understand `how to handle message ?`
It should write 5-bytes into stream, in ideal condition
type NewSubResponse ¶
NewSubResponse - After sending subscriber registration request along with topic list of interest, it expects to hear back with `what's its subcriber id ?` & `how many topics it successfully got subscribed to ?`
type NewSubscriptionRequest ¶
type NewSubscriptionRequest struct {
Topics []string
}
NewSubscriptionRequest - Subscriber to send new topic subscription request over stream
func (*NewSubscriptionRequest) ReadFrom ¶
func (n *NewSubscriptionRequest) ReadFrom(r io.Reader) (int64, error)
ReadFrom - Read subscription request back from stream & constructs object
func (*NewSubscriptionRequest) WriteEnvelope ¶ added in v0.2.0
func (n *NewSubscriptionRequest) WriteEnvelope(w io.Writer) (int64, error)
WriteEnvelope - Subscriber invokes for writing message envelope so that Hub can understand `how to handle message ?`
It should write 5-bytes into stream, in ideal condition
type OP ¶
type OP uint8
type PushedMessage ¶
type PushedMessage pubsub.PublishedMessage
PushedMessage - Manager to push message to subscriber in this form as soon as it's ready to push it, after getting notified by HUB
type UnsubcriptionRequest ¶
UnsubcriptionRequest - Client to send topic unsubscription request in this form
func (*UnsubcriptionRequest) ReadFrom ¶
func (u *UnsubcriptionRequest) ReadFrom(r io.Reader) (int64, error)
ReadFrom - Read unsubscription request back from stream & constructs object
func (*UnsubcriptionRequest) WriteEnvelope ¶ added in v0.2.0
func (u *UnsubcriptionRequest) WriteEnvelope(w io.Writer) (int64, error)
WriteEnvelope - Subscriber invokes for writing message envelope so that Hub can understand `how to handle message ?`
It should write 5-bytes into stream, in ideal condition