Documentation
¶
Overview ¶
Package encoding is used to encode/decode data going to/from the bolt protocol.
Index ¶
Constants ¶
const ( // NilMarker represents the encoding marker byte for a nil object NilMarker = 0xC0 // TrueMarker represents the encoding marker byte for a true boolean object TrueMarker = 0xC3 // FalseMarker represents the encoding marker byte for a false boolean object FalseMarker = 0xC2 // Int8Marker represents the encoding marker byte for a int8 object Int8Marker = 0xC8 // Int16Marker represents the encoding marker byte for a int16 object Int16Marker = 0xC9 // Int32Marker represents the encoding marker byte for a int32 object Int32Marker = 0xCA // Int64Marker represents the encoding marker byte for a int64 object Int64Marker = 0xCB // FloatMarker represents the encoding marker byte for a float32/64 object FloatMarker = 0xC1 // TinyStringMarker represents the encoding marker byte for a string object TinyStringMarker = 0x80 // String8Marker represents the encoding marker byte for a string object String8Marker = 0xD0 // String16Marker represents the encoding marker byte for a string object String16Marker = 0xD1 // String32Marker represents the encoding marker byte for a string object String32Marker = 0xD2 // TinySliceMarker represents the encoding marker byte for a slice object TinySliceMarker = 0x90 // Slice8Marker represents the encoding marker byte for a slice object Slice8Marker = 0xD4 // Slice16Marker represents the encoding marker byte for a slice object Slice16Marker = 0xD5 // Slice32Marker represents the encoding marker byte for a slice object Slice32Marker = 0xD6 // TinyMapMarker represents the encoding marker byte for a map object TinyMapMarker = 0xA0 // Map8Marker represents the encoding marker byte for a map object Map8Marker = 0xD8 // Map16Marker represents the encoding marker byte for a map object Map16Marker = 0xD9 // Map32Marker represents the encoding marker byte for a map object Map32Marker = 0xDA // TinyStructMarker represents the encoding marker byte for a struct object TinyStructMarker = 0xB0 // Struct8Marker represents the encoding marker byte for a struct object Struct8Marker = 0xDC // Struct16Marker represents the encoding marker byte for a struct object Struct16Marker = 0xDD )
Variables ¶
var ( // EndMessage is the data to send to end a message EndMessage = []byte{byte(0x00), byte(0x00)} )
Functions ¶
Types ¶
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
Decoder decodes a message from the bolt protocol stream Attempts to support all builtin golang types, when it can be confidently mapped to a data type from: http://alpha.neohq.net/docs/server-manual/bolt-serialization.html#bolt-packstream-structures (version v3.1.0-M02 at the time of writing this.
Maps and Slices are a special case, where only map[string]interface{} and []interface{} are supported. The interface for maps and slices may be more permissive in the future.
type Encoder ¶
type Encoder struct {
// contains filtered or unexported fields
}
Encoder encodes objects of different types to the given stream. Attempts to support all builtin golang types, when it can be confidently mapped to a data type from: http://alpha.neohq.net/docs/server-manual/bolt-serialization.html#bolt-packstream-structures (version v3.1.0-M02 at the time of writing this.
Maps and Slices are a special case, where only map[string]interface{} and []interface{} are supported. The interface for maps and slices may be more permissive in the future.
func NewEncoder ¶
NewEncoder Creates a new Encoder object