Documentation
¶
Index ¶
- Variables
- func Revert(inp []byte, l uint) []byte
- type BitArray
- func (b *BitArray) Append(ba *BitArray) error
- func (b *BitArray) AsString() string
- func (b *BitArray) Bytes() []byte
- func (b *BitArray) Copy() *BitArray
- func (b *BitArray) Equals(ba *BitArray) bool
- func (b *BitArray) Extract(offset, length uint) (*BitArray, error)
- func (b *BitArray) Length() uint
- func (b *BitArray) Update(ba *BitArray, offset uint) error
- type CompositeListType
- func (d *CompositeListType) Copy() CompositeType
- func (d *CompositeListType) Decode(b *BitArray) error
- func (d *CompositeListType) DecodeSubtype(i int, b *BitArray) error
- func (d *CompositeListType) Encode() (*BitArray, error)
- func (d *CompositeListType) EncodeSubtype(i int) (*BitArray, error)
- func (d *CompositeListType) Equals(dr CompositeType) bool
- func (d *CompositeListType) Get(i int) (Type, error)
- func (d *CompositeListType) IsValid() []bool
- func (d *CompositeListType) Length(i int) (uint, error)
- func (d *CompositeListType) Marshal(format string) (interface{}, error)
- func (d *CompositeListType) Offset(i int) (uint, error)
- func (d *CompositeListType) SetSubtypes(types []Type)
- func (d *CompositeListType) Subtypes() []Type
- func (d *CompositeListType) Unmarshal(format string, value interface{}) error
- type CompositeListTypeIf
- type CompositeType
- func DPS(c CompositeType, key []byte) (CompositeType, error)
- func DPSH(c CompositeType, key []byte) (CompositeType, error)
- func MakeCompositeListType() CompositeType
- func MakeDate(interface{}) (CompositeType, error)
- func MakeIPAddr(params interface{}) (CompositeType, error)
- func MakeInteger(params interface{}) (CompositeType, error)
- func PS(c CompositeType, key []byte) (CompositeType, error)
- func PSH(c CompositeType, key []byte) (CompositeType, error)
- type Date
- type DateElement
- func (h *DateElement) Decode(b *BitArray) error
- func (h *DateElement) Encode() (*BitArray, error)
- func (h *DateElement) Equals(t Type) bool
- func (h *DateElement) Field() byte
- func (h *DateElement) IsValid() bool
- func (h *DateElement) Length() uint
- func (h *DateElement) Order() uint
- func (h *DateElement) SetRange(min, max int64) error
- func (h *DateElement) Value() int64
- type DateElementIf
- type Day
- type Elements
- type FormatField
- type Hour
- type IPAddr
- type IPAddress
- type IPElement
- type IPElementIf
- type Integer
- type IntegerField
- type Minute
- type Month
- type NanoSecond
- type Second
- type TimeZone
- type Type
- func MakeDay(value int64) Type
- func MakeHour(value int64) Type
- func MakeIPAddress(value []byte, mask uint) Type
- func MakeMinute(value int64) Type
- func MakeMonth(value int64) Type
- func MakeNanoSecond(value int64) Type
- func MakeSecond(value int64) Type
- func MakeTimeZone(value int64) Type
- func MakeYear(value int64) Type
- type TypeMaker
- type Year
Constants ¶
This section is empty.
Variables ¶
View Source
var Types = map[string]TypeMaker{ "integer": MakeInteger, "date": MakeDate, "ip": MakeIPAddr, "ipv4": MakeIPAddr, "ipv6": MakeIPAddr, }
Functions ¶
Types ¶
type BitArray ¶
type BitArray struct {
// contains filtered or unexported fields
}
func MakeBitArray ¶
func MakeBitArrayFromBytes ¶
type CompositeListType ¶
type CompositeListType struct {
// contains filtered or unexported fields
}
func (*CompositeListType) Copy ¶
func (d *CompositeListType) Copy() CompositeType
func (*CompositeListType) Decode ¶
func (d *CompositeListType) Decode(b *BitArray) error
func (*CompositeListType) DecodeSubtype ¶
func (d *CompositeListType) DecodeSubtype(i int, b *BitArray) error
func (*CompositeListType) Encode ¶
func (d *CompositeListType) Encode() (*BitArray, error)
func (*CompositeListType) EncodeSubtype ¶
func (d *CompositeListType) EncodeSubtype(i int) (*BitArray, error)
func (*CompositeListType) Equals ¶
func (d *CompositeListType) Equals(dr CompositeType) bool
func (*CompositeListType) IsValid ¶
func (d *CompositeListType) IsValid() []bool
func (*CompositeListType) Marshal ¶
func (d *CompositeListType) Marshal(format string) (interface{}, error)
func (*CompositeListType) SetSubtypes ¶
func (d *CompositeListType) SetSubtypes(types []Type)
func (*CompositeListType) Subtypes ¶
func (d *CompositeListType) Subtypes() []Type
func (*CompositeListType) Unmarshal ¶
func (d *CompositeListType) Unmarshal(format string, value interface{}) error
type CompositeListTypeIf ¶
type CompositeListTypeIf interface {
Subtypes() []Type
}
type CompositeType ¶
type CompositeType interface {
// helper functions to copy, check equality and validity etc...
IsValid() []bool
Equals(CompositeType) bool
Copy() CompositeType
// get info about subtypes
Offset(int) (uint, error)
Length(int) (uint, error)
Get(int) (Type, error)
// marshal and unmarshal to/from a given format
Marshal(format string) (interface{}, error)
Unmarshal(format string, value interface{}) error
// encode and decode a composite type to/from bitarrays
Decode(*BitArray) error
Encode() (*BitArray, error)
EncodeSubtype(int) (*BitArray, error)
DecodeSubtype(int, *BitArray) error
}
func DPS ¶
func DPS(c CompositeType, key []byte) (CompositeType, error)
func DPSH ¶
func DPSH(c CompositeType, key []byte) (CompositeType, error)
func MakeCompositeListType ¶
func MakeCompositeListType() CompositeType
func MakeDate ¶
func MakeDate(interface{}) (CompositeType, error)
func MakeIPAddr ¶
func MakeIPAddr(params interface{}) (CompositeType, error)
func MakeInteger ¶
func MakeInteger(params interface{}) (CompositeType, error)
func PS ¶
func PS(c CompositeType, key []byte) (CompositeType, error)
func PSH ¶
func PSH(c CompositeType, key []byte) (CompositeType, error)
type Date ¶
type Date struct {
CompositeListType
}
func (*Date) Copy ¶
func (d *Date) Copy() CompositeType
type DateElement ¶
type DateElement struct {
// contains filtered or unexported fields
}
func (*DateElement) Decode ¶
func (h *DateElement) Decode(b *BitArray) error
func (*DateElement) Encode ¶
func (h *DateElement) Encode() (*BitArray, error)
func (*DateElement) Equals ¶
func (h *DateElement) Equals(t Type) bool
func (*DateElement) Field ¶
func (h *DateElement) Field() byte
func (*DateElement) IsValid ¶
func (h *DateElement) IsValid() bool
func (*DateElement) Length ¶
func (h *DateElement) Length() uint
func (*DateElement) Order ¶
func (h *DateElement) Order() uint
func (*DateElement) SetRange ¶
func (h *DateElement) SetRange(min, max int64) error
func (*DateElement) Value ¶
func (h *DateElement) Value() int64
type DateElementIf ¶
type FormatField ¶
type FormatField struct {
// contains filtered or unexported fields
}
type IPAddr ¶
type IPAddr struct {
CompositeListType
// contains filtered or unexported fields
}
func (*IPAddr) Copy ¶
func (ip *IPAddr) Copy() CompositeType
type IPElementIf ¶
type Integer ¶
type Integer struct {
CompositeListType
// contains filtered or unexported fields
}
func (*Integer) Copy ¶
func (d *Integer) Copy() CompositeType
type IntegerField ¶
type IntegerField struct {
Max int64
Min int64
Value int64
// contains filtered or unexported fields
}
func MakeIntegerField ¶
func MakeIntegerField(min, max, value int64) (*IntegerField, error)
func (*IntegerField) Copy ¶
func (r *IntegerField) Copy() Type
func (*IntegerField) Decode ¶
func (r *IntegerField) Decode(b *BitArray) error
func (*IntegerField) Encode ¶
func (r *IntegerField) Encode() (*BitArray, error)
func (*IntegerField) Equals ¶
func (r *IntegerField) Equals(t Type) bool
func (*IntegerField) IsValid ¶
func (r *IntegerField) IsValid() bool
func (*IntegerField) Length ¶
func (r *IntegerField) Length() uint
type NanoSecond ¶
type NanoSecond struct {
DateElement
}
func (*NanoSecond) Copy ¶
func (n *NanoSecond) Copy() Type
type TimeZone ¶
type TimeZone struct {
DateElement
}
type Type ¶
type Type interface {
IsValid() bool
Decode(*BitArray) error
Encode() (*BitArray, error)
Length() uint
Copy() Type
Equals(Type) bool
}
func MakeIPAddress ¶
func MakeMinute ¶
func MakeNanoSecond ¶
func MakeSecond ¶
func MakeTimeZone ¶
type TypeMaker ¶
type TypeMaker func(interface{}) (CompositeType, error)
Click to show internal directories.
Click to hide internal directories.