Documentation ¶
Overview ¶
Package conn contains a simple datastructure and some general purpose methods for interacting with it
Index ¶
- Variables
- type Conn
- func (z *Conn) DecodeMsg(dc *msgp.Reader) (err error)
- func (z Conn) EncodeMsg(en *msgp.Writer) (err error)
- func (c Conn) MarshalBinary() ([]byte, error)
- func (z Conn) MarshalMsg(b []byte) (o []byte, err error)
- func (z Conn) Msgsize() (s int)
- func (c *Conn) UnmarshalBinary(b []byte) error
- func (z *Conn) UnmarshalMsg(bts []byte) (o []byte, err error)
- type ID
Constants ¶
This section is empty.
Variables ¶
var NodeID string
NodeID is the unique identifier for this node. It should be set before New connections are generated
Functions ¶
This section is empty.
Types ¶
type Conn ¶
type Conn struct { ID ID `json:"id"` Presence string `json:"presence,omitempty"` IsBackend bool `json:"isBackend,omitempty"` }
Conn represents all the information needed to be stored about a connection
func (Conn) MarshalBinary ¶
MarshalBinary takes returns a binary string representation of the Conn
func (Conn) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
func (Conn) Msgsize ¶
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*Conn) UnmarshalBinary ¶
UnmarshalBinary unmarshals a binary string returned from MarshalBinary into the Conn
type ID ¶
type ID string
ID is used to identify a single connection across all instances of otter in a cluster
func (ID) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
func (ID) Msgsize ¶
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message