Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrUnknownType = errors.New("unknown type")
Functions ¶
This section is empty.
Types ¶
type Marshaler ¶
type Marshaler interface { // Marshal is used to serialize and data to a []byte Marshal(data any) ([]byte, error) // Unmarshal is used to deserialize []byte to any Unmarshal(data []byte, v any) error }
Marshaler interface is to provide serialize and deserialize methods for BRaft Node
func NewMsgPacker ¶
func NewMsgPacker() Marshaler
type TypeRegister ¶
type TypeRegister struct { Marshaler TypeMap map[string]reflect.Type // contains filtered or unexported fields }
func NewTypeRegister ¶
func NewTypeRegister(m Marshaler) *TypeRegister
func (*TypeRegister) RegisterType ¶
func (t *TypeRegister) RegisterType(typ reflect.Type) (typName string, isPtr bool)
type TypeRegisterMarshalerAdapter ¶
type TypeRegisterMarshalerAdapter interface {
Marshal(*TypeRegister) ([]byte, error)
}
type TypeRegisterUnmarshalerAdapter ¶
type TypeRegisterUnmarshalerAdapter interface {
Unmarshal(*TypeRegister, []byte) error
}
Click to show internal directories.
Click to hide internal directories.