Documentation ¶
Overview ¶
Package schema contains the Chitin wire format schema data model and parser.
Index ¶
- type Envelope
- type Field
- type FieldOptions
- type FieldType
- type FixedMessage
- type Message
- type MessageOptions
- type Schema
- type SchemaV1
- type Slot
- type SlotType
- type String
- type Uint16
- func (Uint16) GoFieldBytes(stateVar string) string
- func (Uint16) GoFieldGetter(stateVar string) string
- func (Uint16) GoFieldPrep(stateVar string) string
- func (Uint16) GoSlotGetter() string
- func (Uint16) GoSlotSetter() string
- func (Uint16) GoStateType() string
- func (Uint16) GoType() string
- func (Uint16) SlotSize() uint64
- type VarMessage
- type Versioned
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Field ¶
type Field struct { Name string Kind FieldType Options FieldOptions }
type FieldOptions ¶
type FieldOptions struct {
Align uint32
}
type FieldType ¶
type FieldType interface { GoType() string // Return the data type sufficient to hold data for fast field access. GoStateType() string // Return a template code snippet that assigns to the field given // in stateVar whatever is needed for later fast field access. // Local variable `data` is a `[]byte` with the unprocessed part // of the message, and is to be updated to point past the current // message. // // If field data is malformed, do `return nil, err`. GoFieldPrep(stateVar string) string GoFieldGetter(stateVar string) string // Return a template code snippet that appends to byte slice // `data` the marshaled contents of the field. GoFieldBytes(stateVar string) string // contains filtered or unexported methods }
type FixedMessage ¶
type FixedMessage struct { WireFormat uint32 Options MessageOptions Slots []Slot }
func (*FixedMessage) GetFields ¶
func (m *FixedMessage) GetFields() []Field
func (*FixedMessage) GetSlots ¶
func (m *FixedMessage) GetSlots() []Slot
type MessageOptions ¶
type MessageOptions struct {
Align uint32
}
type Schema ¶
type SlotType ¶
type SlotType interface { SlotSize() uint64 GoType() string GoSlotGetter() string // Return a template code snippet that sets the slow stored in // byte slice `data`. // Local variable `v` is the value to be set, of the type returned // by GoType. GoSlotSetter() string // contains filtered or unexported methods }
type String ¶
type String struct{}
func (String) GoFieldBytes ¶
func (String) GoFieldGetter ¶
func (String) GoFieldPrep ¶
func (String) GoStateType ¶
type Uint16 ¶
type Uint16 struct { }
func (Uint16) GoFieldBytes ¶
func (Uint16) GoFieldGetter ¶
func (Uint16) GoFieldPrep ¶
func (Uint16) GoSlotGetter ¶
func (Uint16) GoSlotSetter ¶
func (Uint16) GoStateType ¶
type VarMessage ¶
type VarMessage struct { WireFormat uint32 Options MessageOptions Slots []Slot Fields []Field }
func (*VarMessage) GetFields ¶
func (m *VarMessage) GetFields() []Field
func (*VarMessage) GetSlots ¶
func (m *VarMessage) GetSlots() []Slot
Click to show internal directories.
Click to hide internal directories.