Documentation ¶
Index ¶
- Constants
- Variables
- func Bytes(p *VPointer) []byte
- func Slab(p *VPointer) (unsafe.Pointer, int32)
- func Slice(p *VPointer) unsafe.Pointer
- func Str(p *VPointer) string
- type BlockHeader
- type BlockHeaderMut
- func (self *BlockHeaderMut) AddCount(value uint16)
- func (self *BlockHeaderMut) Append(blockSize BlockSize, data unsafe.Pointer, size uintptr) error
- func (self *BlockHeaderMut) SetBlockSize(value BlockSize)
- func (self *BlockHeaderMut) SetCount(count uint16)
- func (self *BlockHeaderMut) SetLayout(value BlockLayout)
- func (self *BlockHeaderMut) SetRecord(value uint16)
- func (self *BlockHeaderMut) SetSize(value uint16)
- func (self *BlockHeaderMut) SetSizeU(value uint16)
- type BlockLayout
- type BlockReader
- type BlockRecord
- type BlockSize
- type Builder
- func (b *Builder) Alloc(length, flex int32) Mutable
- func (b *Builder) FieldOffset(field *VPointer) int64
- func (b *Builder) Finish() unsafe.Pointer
- func (b *Builder) FinishPointer() unsafe.Pointer
- func (b *Builder) Get() *Builder
- func (b *Builder) Len() int
- func (b *Builder) New(length, flex int32) Mutable
- func (b *Builder) OffsetOf(p unsafe.Pointer) int64
- func (b *Builder) VPointerOffset(existing *VPointer) int32
- type BuilderPointer
- type BuilderProvider
- type ColumnBlock
- type ColumnBlockMut
- type Encoding
- type Enum
- type EnumOption
- type Expression
- type Field
- func (f *Field) Align() int32
- func (f *Field) Column(count int) (offset, size int)
- func (f *Field) ColumnOffset() int32
- func (f *Field) Comments() []string
- func (f *Field) IsPointer() bool
- func (f *Field) Kind() *Type
- func (f *Field) Name() string
- func (f *Field) Number() uint16
- func (f *Field) Offset() int32
- func (f *Field) Optional() bool
- func (f *Field) Pointer() bool
- func (f *Field) SetAlign(align int32)
- func (f *Field) SetColumnOffset(columnOffset int32)
- func (f *Field) SetComments(comments []string)
- func (f *Field) SetKind(kind Type)
- func (f *Field) SetName(name string)
- func (f *Field) SetNumber(number uint16)
- func (f *Field) SetOffset(offset int32)
- func (f *Field) SetOptional(optional bool)
- func (f *Field) SetPointer(pointer bool)
- func (f *Field) SetShort(short string)
- func (f *Field) Short() string
- type FixedBlock
- type FixedBlockHeaderMut
- type FixedBlockMut
- type FixedBlockReader
- func (fr *FixedBlockReader) Count() int
- func (fr *FixedBlockReader) Current() (unsafe.Pointer, int)
- func (fr *FixedBlockReader) CurrentPtr() unsafe.Pointer
- func (fr *FixedBlockReader) First() (unsafe.Pointer, int)
- func (fr *FixedBlockReader) FirstPtr() unsafe.Pointer
- func (fr *FixedBlockReader) Index() int
- func (fr *FixedBlockReader) Last() (unsafe.Pointer, int)
- func (fr *FixedBlockReader) LastPtr() unsafe.Pointer
- func (fr *FixedBlockReader) Next() (unsafe.Pointer, int)
- func (fr *FixedBlockReader) NextPtr() unsafe.Pointer
- func (fr *FixedBlockReader) Prev() (unsafe.Pointer, int)
- func (fr *FixedBlockReader) PrevPtr() unsafe.Pointer
- type FlexBlockReader
- func (fr *FlexBlockReader) Count() int
- func (fr *FlexBlockReader) Current() (unsafe.Pointer, int)
- func (fr *FlexBlockReader) First() (unsafe.Pointer, int)
- func (fr *FlexBlockReader) Index() int
- func (fr *FlexBlockReader) Last() (unsafe.Pointer, int)
- func (fr *FlexBlockReader) Next() (unsafe.Pointer, int)
- func (fr *FlexBlockReader) Prev() (unsafe.Pointer, int)
- type Format
- type Import
- type ImportGroup
- type Kind
- type Line
- type List
- type Loader
- type Map
- type Mutable
- func (b *Mutable) Free(vp *VPointer)
- func (mut Mutable) IsEmpty() bool
- func (mut *Mutable) IsNil() bool
- func (mut *Mutable) IsRoot() bool
- func (b *Mutable) Slice(p unsafe.Pointer) Mutable
- func (b *Mutable) SliceAlloc(vp *VPointer, size int32) Mutable
- func (mut *Mutable) Unsafe() unsafe.Pointer
- func (b *Mutable) WStr(existing *VPointer, value string)
- func (b *Mutable) WriteBytes(existing *VPointer, value []byte)
- type Parser
- type Record
- func (r *Record) Align() int32
- func (r *Record) Comments() []string
- func (record *Record) DoLayout()
- func (r *Record) Field(name string) *Field
- func (r *Record) FieldAt(index int) *Field
- func (r *Record) Fields() []Field
- func (r *Record) FieldsMap() map[string]*Field
- func (r *Record) Fixed() bool
- func (r *Record) Layout() RecordLayout
- func (r *Record) LayoutColumns(offset int32) error
- func (r *Record) Line() Line
- func (r *Record) Name() string
- func (r *Record) Offset() int32
- func (r *Record) OptionalOffset() int32
- func (r *Record) OptionalSize() int32
- func (r *Record) Optionals() int32
- func (r *Record) SetAlign(align int32)
- func (r *Record) SetComments(comments []string)
- func (r *Record) SetFields(fields []Field)
- func (r *Record) SetFieldsMap(fieldsMap map[string]*Field)
- func (r *Record) SetFixed(fixed bool)
- func (r *Record) SetLayout(layout RecordLayout)
- func (r *Record) SetLine(line Line)
- func (r *Record) SetName(name string)
- func (r *Record) SetOffset(offset int32)
- func (r *Record) SetOptionalOffset(optionalOffset int32)
- func (r *Record) SetOptionalSize(optionalSize int32)
- func (r *Record) SetOptionals(optionals int32)
- func (r *Record) SetSize(size int32)
- func (r *Record) SetVersion(version int64)
- func (r *Record) SetVersionOffset(versionOffset int32)
- func (r *Record) SetVersionSize(versionSize int32)
- func (r *Record) Size() int32
- func (r *Record) ToColumns(columns []*Field) []*Field
- func (r *Record) Version() int64
- func (r *Record) VersionOffset() int32
- func (r *Record) VersionSize() int32
- type RecordHeader
- type RecordLayout
- type Schema
- func (s *Schema) Alias() string
- func (s *Schema) Fqn() string
- func (s *Schema) Layout()
- func (s *Schema) Name() string
- func (s *Schema) SetAlias(alias string)
- func (s *Schema) SetFqn(fqn string)
- func (s *Schema) SetName(name string)
- func (s *Schema) SetTypes(types []Type)
- func (s *Schema) SetTypesMap(typesMap map[string]*Type)
- func (s *Schema) Types() []Type
- func (s *Schema) TypesMap() map[string]*Type
- type Stream
- func (s *Stream) Kind() StreamKind
- func (s *Stream) Layout() BlockLayout
- func (s *Stream) Name() string
- func (s *Stream) Record() *Record
- func (s *Stream) SetKind(kind StreamKind)
- func (s *Stream) SetLayout(layout BlockLayout)
- func (s *Stream) SetName(name string)
- func (s *Stream) SetRecord(record *Record)
- type StreamKind
- type Type
- func (d *Type) Align() int32
- func (d *Type) Enum() *Enum
- func (d *Type) Kind() Kind
- func (d *Type) Line() Line
- func (d *Type) List() *List
- func (d *Type) Map() *Map
- func (d *Type) Record() *Record
- func (d *Type) SetAlign(v int32) *Type
- func (d *Type) SetEnum(v *Enum) *Type
- func (d *Type) SetKind(v Kind) *Type
- func (d *Type) SetLine(line Line)
- func (d *Type) SetList(v *List) *Type
- func (d *Type) SetMap(v *Map) *Type
- func (d *Type) SetRecord(v *Record) *Type
- func (d *Type) SetSize(v int32) *Type
- func (d *Type) SetStream(v *Stream) *Type
- func (d *Type) SetUnion(v *Union) *Type
- func (d *Type) Size() int32
- func (d *Type) Stream() *Stream
- func (d *Type) Union() *Union
- type Union
- func (union *Union) Align() int32
- func (union *Union) DoLayout()
- func (union *Union) Fields() []Field
- func (union *Union) Kind() UnionKind
- func (union *Union) Name() string
- func (union *Union) SetAlign(align int32)
- func (union *Union) SetFields(fields []Field)
- func (union *Union) SetKind(kind UnionKind)
- func (union *Union) SetName(name string)
- func (union *Union) SetSize(size int32)
- func (union *Union) Size() int32
- type UnionKind
- type VPointer
Constants ¶
const ( KindUnknown = Kind(0) // Possibly resolved later KindBool = Kind(1) KindByte = Kind(2) KindInt8 = Kind(3) KindInt16 = Kind(4) KindUInt16 = Kind(5) KindInt32 = Kind(6) KindUInt32 = Kind(7) KindInt64 = Kind(8) KindUInt64 = Kind(9) KindFloat32 = Kind(10) KindFloat64 = Kind(11) KindString = Kind(12) KindStringInline = Kind(13) KindBytes = Kind(14) KindBytesInline = Kind(15) KindRecordHeader = Kind(17) KindBlockHeader = Kind(18) KindRef = Kind(25) KindEnum = Kind(30) // User-defined enum KindRecord = Kind(40) // User-defined variable sized record KindStruct = Kind(41) // User-defined fixed sized record KindList = Kind(50) KindListInline = Kind(51) KindMap = Kind(60) KindMapInline = Kind(61) KindUnion = Kind(70) // User-defined union KindUnionUntagged = Kind(71) // User-defined union KindStream = Kind(80) KindPad = Kind(100) // struct alignment padding )
const (
VPointerSize = int32(4)
)
Variables ¶
var (
ErrColumnPointer = errors.New("columns cannot be pointer type")
)
var (
ErrOutOfMemory = errors.New("out of memory")
)
Functions ¶
Types ¶
type BlockHeader ¶
type BlockHeader struct {
// contains filtered or unexported fields
}
func (*BlockHeader) BlockSize ¶
func (self *BlockHeader) BlockSize() BlockSize
func (*BlockHeader) Count ¶
func (self *BlockHeader) Count() uint16
func (*BlockHeader) Layout ¶
func (self *BlockHeader) Layout() BlockLayout
func (*BlockHeader) Size ¶
func (self *BlockHeader) Size() uint16
func (*BlockHeader) SizeU ¶
func (self *BlockHeader) SizeU() uint16
type BlockHeaderMut ¶
type BlockHeaderMut struct {
BlockHeader
}
func (*BlockHeaderMut) AddCount ¶
func (self *BlockHeaderMut) AddCount(value uint16)
func (*BlockHeaderMut) SetBlockSize ¶
func (self *BlockHeaderMut) SetBlockSize(value BlockSize)
func (*BlockHeaderMut) SetCount ¶
func (self *BlockHeaderMut) SetCount(count uint16)
func (*BlockHeaderMut) SetLayout ¶
func (self *BlockHeaderMut) SetLayout(value BlockLayout)
func (*BlockHeaderMut) SetRecord ¶
func (self *BlockHeaderMut) SetRecord(value uint16)
func (*BlockHeaderMut) SetSize ¶
func (self *BlockHeaderMut) SetSize(value uint16)
func (*BlockHeaderMut) SetSizeU ¶
func (self *BlockHeaderMut) SetSizeU(value uint16)
type BlockLayout ¶
type BlockLayout byte
const ( BlockLayoutRow BlockLayout = 0 BlockLayoutColumn BlockLayout = 1 )
type BlockReader ¶
type BlockRecord ¶
type BlockRecord struct { }
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
func NewBuilder ¶
func NewBuilder() *Builder
func (*Builder) FieldOffset ¶
func (*Builder) FinishPointer ¶
func (*Builder) VPointerOffset ¶
type BuilderPointer ¶
type BuilderPointer struct {
*Builder
}
func AllocBuilder ¶
func AllocBuilder() BuilderPointer
func (*BuilderPointer) Close ¶
func (b *BuilderPointer) Close() error
type BuilderProvider ¶
type BuilderProvider interface {
Get() *Builder
}
type ColumnBlock ¶
type ColumnBlock struct {
FixedBlock
}
type ColumnBlockMut ¶
type ColumnBlockMut struct {
FixedBlockHeaderMut
}
type Enum ¶
type Enum struct {
// contains filtered or unexported fields
}
func (*Enum) Options ¶
func (e *Enum) Options() []EnumOption
func (*Enum) SetOptions ¶
func (e *Enum) SetOptions(options []EnumOption)
type EnumOption ¶
type EnumOption struct {
// contains filtered or unexported fields
}
func (*EnumOption) Name ¶
func (e *EnumOption) Name() string
func (*EnumOption) SetName ¶
func (e *EnumOption) SetName(name string)
func (*EnumOption) SetValue ¶
func (e *EnumOption) SetValue(value int64)
func (*EnumOption) SetValueU ¶
func (e *EnumOption) SetValueU(valueU uint64)
func (*EnumOption) Value ¶
func (e *EnumOption) Value() int64
func (*EnumOption) ValueU ¶
func (e *EnumOption) ValueU() uint64
type Expression ¶
type Expression string
type Field ¶
type Field struct {
// contains filtered or unexported fields
}
Field represents a field on a Record, List Element, or Map Key/Value
func (*Field) ColumnOffset ¶
func (*Field) SetColumnOffset ¶
func (*Field) SetComments ¶
func (*Field) SetOptional ¶
func (*Field) SetPointer ¶
type FixedBlock ¶
type FixedBlock struct {
BlockHeader
}
func (*FixedBlock) Reader ¶
func (h *FixedBlock) Reader() *FixedBlockReader
type FixedBlockHeaderMut ¶
type FixedBlockHeaderMut struct {
BlockHeaderMut
}
type FixedBlockMut ¶
type FixedBlockMut struct {
BlockHeader
}
type FixedBlockReader ¶
type FixedBlockReader struct {
// contains filtered or unexported fields
}
FixedBlockReader reads fixed sized records
func NewFixedReader ¶
func NewFixedReader(header *BlockHeader) FixedBlockReader
func (*FixedBlockReader) Count ¶
func (fr *FixedBlockReader) Count() int
func (*FixedBlockReader) CurrentPtr ¶
func (fr *FixedBlockReader) CurrentPtr() unsafe.Pointer
func (*FixedBlockReader) FirstPtr ¶
func (fr *FixedBlockReader) FirstPtr() unsafe.Pointer
func (*FixedBlockReader) Index ¶
func (fr *FixedBlockReader) Index() int
func (*FixedBlockReader) LastPtr ¶
func (fr *FixedBlockReader) LastPtr() unsafe.Pointer
func (*FixedBlockReader) NextPtr ¶
func (fr *FixedBlockReader) NextPtr() unsafe.Pointer
func (*FixedBlockReader) PrevPtr ¶
func (fr *FixedBlockReader) PrevPtr() unsafe.Pointer
type FlexBlockReader ¶
type FlexBlockReader struct {
// contains filtered or unexported fields
}
FlexBlockReader reads variable length records. Each record has its uint16 size prepended and appended. uint16 | data | uint16 | uint16 | data | uint16
func (*FlexBlockReader) Count ¶
func (fr *FlexBlockReader) Count() int
func (*FlexBlockReader) Index ¶
func (fr *FlexBlockReader) Index() int
type ImportGroup ¶
type ImportGroup struct {
// contains filtered or unexported fields
}
type List ¶
type List struct {
// contains filtered or unexported fields
}
List represents an Array like structure. Header: | LEN 2 bytes | [LEN]Element
func (*List) SetElement ¶
type Map ¶
type Map struct {
// contains filtered or unexported fields
}
Map represents a HashMap data structure using a robin-hood algorithm Header: | LEN 2 bytes | SIZE 2 bytes | List<MapEntry> Item: | KEY | VALUE | Distance (2 bytes)
type Mutable ¶
type Mutable struct { *Builder // contains filtered or unexported fields }
func (*Mutable) SliceAlloc ¶
SliceAlloc gets the sub Buffer pointed by VPointer allocating if VPointer is 0. It guarantees the sub Buffer is allocated.
func (*Mutable) WriteBytes ¶
type Record ¶
type Record struct {
// contains filtered or unexported fields
}
func (*Record) Layout ¶
func (r *Record) Layout() RecordLayout
func (*Record) LayoutColumns ¶
func (*Record) OptionalOffset ¶
func (*Record) OptionalSize ¶
func (*Record) SetComments ¶
func (*Record) SetFieldsMap ¶
func (*Record) SetLayout ¶
func (r *Record) SetLayout(layout RecordLayout)
func (*Record) SetOptionalOffset ¶
func (*Record) SetOptionalSize ¶
func (*Record) SetOptionals ¶
func (*Record) SetVersion ¶
func (*Record) SetVersionOffset ¶
func (*Record) SetVersionSize ¶
func (*Record) VersionOffset ¶
func (*Record) VersionSize ¶
type RecordHeader ¶
type RecordHeader struct {
// contains filtered or unexported fields
}
type RecordLayout ¶
type RecordLayout int32
const ( RecordLayoutCompact RecordLayout = 0 RecordLayoutAligned RecordLayout = 1 )
type Schema ¶
type Schema struct {
// contains filtered or unexported fields
}
func (*Schema) SetTypesMap ¶
type Stream ¶
type Stream struct {
// contains filtered or unexported fields
}
Stream is a special type for Streaming. It's a list of Records that fits inside 1KB, 2KB, 4KB, 8KB, 16KB, 32KB or 64KB blocks.
func (*Stream) Kind ¶
func (s *Stream) Kind() StreamKind
func (*Stream) Layout ¶
func (s *Stream) Layout() BlockLayout
func (*Stream) SetKind ¶
func (s *Stream) SetKind(kind StreamKind)
func (*Stream) SetLayout ¶
func (s *Stream) SetLayout(layout BlockLayout)
type StreamKind ¶
type StreamKind byte
const ( StreamKindLog StreamKind = 0 StreamKindSeries StreamKind = 1 )
type Type ¶
type Type struct {
// contains filtered or unexported fields
}
func BytesInlineType ¶
func NumberType ¶
func StringInlineType ¶
func StringType ¶
func StringType() Type
type Union ¶
type Union struct {
// contains filtered or unexported fields
}
Union represents a C-like union or a protobuf oneOf
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
compile
|
|
go/protobuf
Package protowire parses and formats the raw wire encoding.
|
Package protowire parses and formats the raw wire encoding. |
Package jlexer contains a JSON lexer implementation.
|
Package jlexer contains a JSON lexer implementation. |
intern
Package intern interns strings.
|
Package intern interns strings. |