Documentation
¶
Index ¶
- Variables
- func EncodeUnit(unit *FilledUnit) (*[]byte, error)
- func UserEncode(u UserFacingHermodUnit) (*[]byte, error)
- type BigInteger
- type BigSignedInteger
- type Boolean
- type Field
- type FieldValue
- type FilledUnit
- type Integer
- type SignedInteger
- type SmallInteger
- type SmallSignedInteger
- type String
- type TinyInteger
- type TinySignedInteger
- type Unit
- type UserFacingHermodUnit
Constants ¶
This section is empty.
Variables ¶
View Source
var False = Boolean(0x00)
View Source
var True = Boolean(0xff)
Functions ¶
func EncodeUnit ¶
func EncodeUnit(unit *FilledUnit) (*[]byte, error)
EncodeUnit converts a Unit into a Hermod-encoded byte slice. [2 bytes transmission ID] then for each field value: [2 bytes field ID] [4 bytes content length in bytes (n)] [n bytes content]
func UserEncode ¶
func UserEncode(u UserFacingHermodUnit) (*[]byte, error)
Types ¶
type BigInteger ¶
type BigInteger uint64
type BigSignedInteger ¶
type BigSignedInteger int64
type FieldValue ¶
type FieldValue struct { ParentUnit *FilledUnit Value interface{} }
type FilledUnit ¶
type FilledUnit struct { *Unit Values map[Field]FieldValue }
func DecodeUnit ¶
func DecodeUnit(_rawUnit *[]byte, unit Unit) (*FilledUnit, error)
DecodeUnit attempts (blindly) to decode a Hermod-encoded byte slice into a FilledUnit Errors are returned only for content issues. Structural issues may cause unexpected behaviour, panics, or even infinite loops!
func UserToFilledUnit ¶
func UserToFilledUnit(u UserFacingHermodUnit) (*FilledUnit, error)
type SignedInteger ¶
type SignedInteger int32
type SmallInteger ¶
type SmallInteger uint16
type SmallSignedInteger ¶
type SmallSignedInteger int16
type TinyInteger ¶
type TinyInteger uint8
type TinySignedInteger ¶
type TinySignedInteger int8
type UserFacingHermodUnit ¶
type UserFacingHermodUnit interface { GetDefinition() *Unit DecodeAbstract(data *[]byte) (UserFacingHermodUnit, error) }
func FilledUnitToUser ¶
func FilledUnitToUser(filledUnit *FilledUnit, u UserFacingHermodUnit) (UserFacingHermodUnit, error)
func UserDecode ¶
func UserDecode(u UserFacingHermodUnit, data *[]byte) (UserFacingHermodUnit, error)
Click to show internal directories.
Click to hide internal directories.