Documentation
¶
Index ¶
- type Header
- type Hello
- type Marshaller
- func (m Marshaller) ApplyPatch(msg any, buf []byte) (retSize uint64, retErr error)
- func (m Marshaller) ID(msg any) (uint64, error)
- func (m Marshaller) IsPatchNeeded(msgDst, msgSrc any) (bool, error)
- func (m Marshaller) MakePatch(msgDst, msgSrc any, buf []byte) (retID, retSize uint64, retErr error)
- func (m Marshaller) Marshal(msg any, buf []byte) (retID, retSize uint64, retErr error)
- func (m Marshaller) Messages() []any
- func (m Marshaller) Size(msg any) (uint64, error)
- func (m Marshaller) Unmarshal(id uint64, buf []byte) (retMsg any, retSize uint64, retErr error)
- type MessageDescriptor
- type MessageID
- type Namespace
- type NamespaceRequest
- type PeerID
- type Revision
- type RevisionDescriptor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Header ¶
type Header struct {
Sender PeerID
Revision RevisionDescriptor
}
Header describes the following message.
type Hello ¶
type Hello struct {
PeerID PeerID
IsServer bool
Requests []NamespaceRequest
}
Hello is the message exchanged between peers when connecting.
type Marshaller ¶
type Marshaller struct {
}
Marshaller marshals and unmarshals messages.
func (Marshaller) ApplyPatch ¶
func (m Marshaller) ApplyPatch(msg any, buf []byte) (retSize uint64, retErr error)
ApplyPatch applies patch.
func (Marshaller) ID ¶
func (m Marshaller) ID(msg any) (uint64, error)
ID returns ID of message type.
func (Marshaller) IsPatchNeeded ¶ added in v0.3.0
func (m Marshaller) IsPatchNeeded(msgDst, msgSrc any) (bool, error)
IsPatchNeeded checks if non-empty patch exists.
func (Marshaller) MakePatch ¶
func (m Marshaller) MakePatch(msgDst, msgSrc any, buf []byte) (retID, retSize uint64, retErr error)
MakePatch creates a patch.
func (Marshaller) Marshal ¶
func (m Marshaller) Marshal(msg any, buf []byte) (retID, retSize uint64, retErr error)
Marshal marshals message.
func (Marshaller) Messages ¶
func (m Marshaller) Messages() []any
Messages returns list of the message types supported by marshaller.
type MessageDescriptor ¶
MessageDescriptor uniquely identifies type of exchanged message.
type NamespaceRequest ¶
NamespaceRequest defines messages to receive.
type Revision ¶
type Revision uint64
Revision is the revision of the message used for deduplication.
type RevisionDescriptor ¶
type RevisionDescriptor struct {
Message MessageDescriptor
Index Revision
}
RevisionDescriptor uniquely identifies revision of message.
Click to show internal directories.
Click to hide internal directories.