Documentation
¶
Overview ¶
Package msg pkg/cxo/node/msg/msg.go c2-net-cxo
Index ¶
Constants ¶
View Source
const ( PingType = 1 + iota // 1 PongType // 2 SynType // 3 AckType // 4 OkType // 5 ErrType // 6 SubType // 7 UnsubType // 8 RqListType // 9 ListType // 10 RootType // 11 RqObjectType // 12 ObjectType // 13 RqPreviewType // 14 RqPeersType // 15 PeersType // 16 )
Types
View Source
const Version uint16 = 3
Version is current protocol version
Variables ¶
View Source
var ( // ErrEmptyMessage occurs when you // try to Decode an empty slice ErrEmptyMessage = errors.New("empty message") // ErrIncomplieDecoding occurs when incoming message // decoded correctly but the decoding doesn't use // entire encoded message ErrIncomplieDecoding = errors.New("incomplete decoding") )
Functions ¶
This section is empty.
Types ¶
type Ack ¶
An Ack is response for the Syn if handshake has been accepted. Otherwise, the Err returned
type InvalidTypeError ¶
type InvalidTypeError struct {
// contains filtered or unexported fields
}
An InvalidTypeError represents decoding error when incoming message is malformed and its type invalid
func (InvalidTypeError) Error ¶
func (e InvalidTypeError) Error() string
Error implements builting error interface
func (InvalidTypeError) Type ¶
func (e InvalidTypeError) Type() Type
Type return Type which cause the error
type Msg ¶
type Msg interface {
Type() Type // type of the message to encode
Encode() []byte // encode the message to []byte prefixed with the Type
}
A Msg is common interface for CXO messages
type Object ¶
type Object struct {
Value []byte // encoded object in person
}
An Object reperesents encoded object
type Root ¶
type Root struct {
Feed cipher.PubKey // feed }
Nonce uint64 // head } Root selector
Seq uint64 // seq }
Value []byte // encoded Root in person
Sig cipher.Sig // signature
}
A Root sent from one node to another one to update root object of feed described in Feed field of the message
Click to show internal directories.
Click to hide internal directories.