Documentation ¶
Index ¶
- Constants
- Variables
- func AddName(s string)
- func ApplyRequestNameFields()
- func AtoiNoErr(i int, e error) int
- func FF(s string, v ...interface{})
- func FbsString(node *Node) []byte
- func GetTypeGroup(s string) (result int)
- func HasNameType(s string) bool
- func IsFieldBasicType(i int) bool
- func IsFieldBytes(i int) bool
- func IsFieldSlice(i int) bool
- func IsFieldStruct(i int) bool
- func IsFieldTable(i int) bool
- func IsFieldUnion(i int) bool
- func IsMatchBit(i, j int) bool
- func IsSameField(i, j uint32) bool
- func IsSameTable(i, j uint32) bool
- func IsUnionName(s string) bool
- func L2isEnable(param Log2Option) bool
- func Log(l LogLevel, fn LogFn)
- func Log2(opts ...Log2Option) (result interface{})
- func MaxInt(vals ...int) (r int)
- func MinInt(vals ...int) (r int)
- func NameToTypeEnum(s string) int
- func NodeFieldSynmbol(node, field string) (uint32, error)
- func RequestSettingNameFields(nName, fName, fType string, fNum int) bool
- func SetAlias(union, alias string) bool
- func SetIdxToName(name string, v map[int]string)
- func SetIdxToType(name string, v map[int]int)
- func SetL2Current(level log.LogLevel, filter byte)
- func SetLogLevel(l LogLevel)
- func SetNameIsStrunct(name string, enable bool) bool
- func SetNameToIdx(name string, v map[string]int)
- func SetRootName(s string)
- func SetdxToTypeGroup(name string, v map[int]int)
- func SumInts(ints []int) int
- func Symbol(s string) int
- func SymbolToNames(idx uint32) (node, field string, e error)
- func SymbolToString(i int) string
- func ToBool(s string) bool
- func VlensTotals(lists []*List) ([]int, []int)
- type BaseImpl
- func (b *BaseImpl) AddDirty(d Dirty)
- func (b *BaseImpl) AddRDiff(diff Diff) error
- func (b *BaseImpl) BufInfo() (infos BufInfo)
- func (b *BaseImpl) Bytes() []byte
- func (b *BaseImpl) C(off, size int, src []byte) error
- func (b *BaseImpl) ClearValueInfoOnDirty(node *NodeList)
- func (b *BaseImpl) Copy(src IO, srcOff, size, dstOff, extend int)
- func (b *BaseImpl) D(off, size int) *Diff
- func (b *BaseImpl) Dedup()
- func (b *BaseImpl) Dump(pos int, opts ...DumpOptFn) (out string)
- func (b *BaseImpl) Dup() (dst IO)
- func (b *BaseImpl) Equal(c *BaseImpl) bool
- func (b *BaseImpl) Flatten()
- func (b *BaseImpl) FlattenWithLen(l int)
- func (b *BaseImpl) GetDiffs() []Diff
- func (b *BaseImpl) HasIoReader() bool
- func (b *BaseImpl) Impl() *BaseImpl
- func (b *BaseImpl) LenBuf() int
- func (b *BaseImpl) Merge()
- func (b *BaseImpl) MergeDiffs()
- func (b *BaseImpl) New(n IO) IO
- func (b *BaseImpl) NewFromBytes(bytes []byte) IO
- func (b *BaseImpl) Next(skip int) IO
- func (b *BaseImpl) R(off int, opts ...OptIO) (result []byte)
- func (b *BaseImpl) Read(p []byte) (n int, e error)
- func (b *BaseImpl) ReadAt(p []byte, i int64) (int, error)
- func (b *BaseImpl) SetDiffs(d []Diff)
- func (b *BaseImpl) ShouldCheckBound() bool
- func (b *BaseImpl) Type() uint8
- func (b *BaseImpl) U(off, size int) []byte
- func (b *BaseImpl) Write(p []byte) (n int, err error)
- func (b *BaseImpl) WriteAt(p []byte, oi int64) (n int, err error)
- type Bool
- type BufInfo
- type Byte
- type CommonList
- func (dst *CommonList) Add(src *CommonList) (nList *CommonList, e error)
- func (l *CommonList) At(i int) (*CommonNode, error)
- func (l *CommonList) DataLen() int
- func (l *CommonList) DataWriter() io.Writer
- func (l *CommonList) SetAt(i int, elm *CommonNode) error
- func (l *CommonList) SetDataWriter(w io.Writer)
- func (l *CommonList) VLen() uint32
- func (l *CommonList) WriteDataAll() (e error)
- func (l *CommonList) WriteElm(elm *CommonNode, pos, size int)
- type CommonNode
- func (node *CommonNode) AllTree() *Tree
- func (node *CommonNode) CanFollow(idx int) bool
- func (node *CommonNode) Count() int
- func (node *CommonNode) CountOfField() int
- func (node *CommonNode) DumpTableWithVTable() string
- func (n1 *CommonNode) Equal(n2 *CommonNode) bool
- func (node *CommonNode) FetchIndex()
- func (node *CommonNode) FieldAt(idx int) (cNode *CommonNode)
- func (node *CommonNode) FindTree(cond TreeCond) <-chan *Tree
- func (node *CommonNode) FollowUnion(idx int) *CommonNode
- func (node *CommonNode) InRoot() bool
- func (node *CommonNode) Info() (info Info)
- func (node *CommonNode) Init() error
- func (node *CommonNode) InsertBuf(pos, size int)
- func (node *CommonNode) InsertSpace(pos, size int, isInsert bool)
- func (node *CommonNode) IsLeafAt(j int) bool
- func (node *CommonNode) IsList() bool
- func (node *CommonNode) IsRoot() bool
- func (node *CommonNode) IsSameType(idx int, fNode *CommonNode) bool
- func (node *CommonNode) Len() int
- func (node *CommonNode) List() *List
- func (node *CommonNode) RootCommon() *CommonNode
- func (node *CommonNode) SearchInfo(pos int, fn RecFn, condFn CondFn)
- func (node *CommonNode) SelfAsCommonNode() *CommonNode
- func (node *CommonNode) SetBool(v bool) error
- func (node *CommonNode) SetByte(v byte) error
- func (node *CommonNode) SetFieldAt(idx int, fNode *CommonNode) error
- func (node *CommonNode) SetFloat32(v float32) error
- func (node *CommonNode) SetFloat64(v float64) error
- func (node *CommonNode) SetInt16(v int16) error
- func (node *CommonNode) SetInt32(v int32) error
- func (node *CommonNode) SetInt64(v int64) error
- func (node *CommonNode) SetInt8(v int8) error
- func (node *CommonNode) SetUint16(v uint16) error
- func (node *CommonNode) SetUint32(v uint32) error
- func (node *CommonNode) SetUint64(v uint64) error
- func (node *CommonNode) SetUint8(v uint8) error
- func (node *CommonNode) TraverseInfo(pos int, fn TraverseRec, condFn TraverseCond)
- func (node *CommonNode) TraverseInfoSlice(pos int, fn TraverseRec, condFn TraverseCond)
- func (node *CommonNode) Unmarshal(v interface{}) error
- func (node *CommonNode) ValueInfo(idx int) ValueInfo
- type CondFn
- type Diff
- type Diffs
- type DiffsIndexResult
- type DirectReader
- type Dirty
- type DoubleLayer
- func (b DoubleLayer) Copy(osrc IO, srcOff, size, dstOff, extend int)
- func (b DoubleLayer) D(off, size int) *Diff
- func (b DoubleLayer) Dup() (dst IO)
- func (b DoubleLayer) New(n IO) IO
- func (b DoubleLayer) NewFromBytes(bytes []byte) IO
- func (b DoubleLayer) R(off int, opts ...OptIO) []byte
- func (b DoubleLayer) Type() uint8
- func (b DoubleLayer) U(off, size int) []byte
- type DumpOpt
- type DumpOptFn
- type ErrorMustRead
- type FieldsDefile
- type Float32
- type Float64
- type GlobalConfig
- type IO
- type Info
- type Int16
- type Int32
- type Int64
- type Int8
- type L2Run
- type List
- func (list *List) Add(slist *List) error
- func (node *List) All() []*CommonNode
- func (node *List) At(i int) (*CommonNode, error)
- func (node *List) AtWihoutError(i int) *CommonNode
- func (node *List) Count() int
- func (node *List) Find(fn func(m *CommonNode) bool) *CommonNode
- func (node *List) First() (*CommonNode, error)
- func (node *List) InfoSlice() Info
- func (node *List) InitList() error
- func (node *List) IsList() bool
- func (node *List) IsSorted(less func(i, j int) bool) (result bool)
- func (node *List) Last() (*CommonNode, error)
- func (node *List) Len() int
- func (node *List) Less(i, j int) bool
- func (node *List) New(optFns ...ListOpt) (sub *List)
- func (node *List) SearchIndex(n int, fn func(c *CommonNode) bool) int
- func (node *List) SearchInfoSlice(pos int, fn RecFn, condFn CondFn)
- func (node *List) Select(fn func(m *CommonNode) bool) []*CommonNode
- func (node *List) SelfAsCommonNode() *CommonNode
- func (node *List) SetAt(idx int, elm *CommonNode) error
- func (node *List) SortBy(less func(i, j int) bool) error
- func (node *List) Swap(i, j int)
- func (node *List) SwapAt(i, j int) error
- func (node *List) VLen() uint32
- type ListOpt
- type ListOption
- type ListOpts
- type Log2Option
- type LogArgs
- type LogFmtParam
- type LogFn
- type LogLevel
- type LogOptParam
- type LogState
- type NoLayer
- func (b NoLayer) Copy(osrc IO, srcOff, size, dstOff, extend int)
- func (b NoLayer) D(off, size int) *Diff
- func (b NoLayer) Dup() (dst IO)
- func (b NoLayer) New(n IO) IO
- func (b NoLayer) NewFromBytes(bytes []byte) IO
- func (b NoLayer) R(off int, opts ...OptIO) []byte
- func (b NoLayer) Type() uint8
- func (b NoLayer) U(off, size int) []byte
- type Node
- func (node *Node) BaseToNoLayer()
- func (node *Node) Bool() bool
- func (node *Node) Byte() byte
- func (node *Node) Bytes() []byte
- func (node *Node) Float32() float32
- func (node *Node) Float64() float64
- func (node *Node) Int16() int16
- func (node *Node) Int32() int32
- func (node *Node) Int64() int64
- func (node *Node) Int8() int8
- func (node *Node) Table(idx int) int
- func (node *Node) TableLen() int
- func (node *Node) Uint16() uint16
- func (node *Node) Uint32() uint32
- func (node *Node) Uint64() uint64
- func (node *Node) Uint8() uint8
- func (node *Node) Unmarshal(ptr interface{}, setter UnmarshalFn) error
- func (node *Node) ValueInfoPosBytes(vIdx int) (info ValueInfo)
- func (node *Node) ValueInfoPosList(vIdx int) (info ValueInfo)
- func (node *Node) ValueList(vIdx int) NodeList
- func (node *Node) ValueStruct(vIdx int) *Node
- func (node *Node) ValueTable(vIdx int) *Node
- func (node *Node) VirtualTable(idx int) int
- func (node *Node) VirtualTableIsZero(idx int) bool
- func (node *Node) VirtualTableLen() int
- type NodeList
- type NodePath
- type Noder
- type OptGlobalConf
- type OptIO
- type Option
- type OptionState
- type ParamIO
- type RawBufInfo
- type ReaderAt
- type ReaderWithAt
- type RecFn
- type ReqestNameField
- type Root
- type Searcher
- type TraverseCond
- type TraverseRec
- type Tree
- type TreeCond
- type Uint16
- type Uint32
- type Uint64
- type Uint8
- type UnionNoder
- type UnmarshalFn
- type Value
- type ValueInfo
Constants ¶
const ( // DEFAULT_BUF_CAP .. cap size of Base's buffef([]byte) DEFAULT_BUF_CAP = 512 // DEFAULT_NODE_BUF_CAP ... cap size of Base's buffer via CreateNode DEFAULT_NODE_BUF_CAP = 64 )
const ( BASE_IMPL = iota BASE_NO_LAYER BASE_DOUBLE_LAYER BASE_DIRECT_READER )
const ( FLT_NONE = 1 << iota FLT_NORMAL FLT_IS FLT_IO )
const ( SizeOfbool = 1 SizeOfint8 = 1 SizeOfint16 = 2 SizeOfuint16 = 2 SizeOfint32 = 4 SizeOfuint32 = 4 SizeOfint64 = 8 SizeOfuint64 = 8 SizeOffloat32 = 4 SizeOffloat64 = 8 SizeOfuint8 = 1 SizeOfbyte = 1 )
const ( TypeBool = iota TypeByte TypeInt8 TypeInt16 TypeInt32 TypeInt64 TypeUint8 TypeUint16 TypeUint32 TypeUint64 TypeFloat32 TypeFloat64 )
const ( FieldTypeNone = 1 << iota FieldTypeStruct FieldTypeTable FieldTypeUnion FieldTypeSlice FieldTypeBasic1 FieldTypeBasic2 FieldTypeBasic4 FieldTypeBasic8 )
const FieldTypeBasic = FieldTypeBasic1 | FieldTypeBasic2 | FieldTypeBasic4 | FieldTypeBasic8
Variables ¶
var ( ERR_MUST_POINTER error = log.ERR_MUST_POINTER ERR_INVALID_TYPE error = log.ERR_INVALID_TYPE ERR_NOT_FOUND error = log.ERR_NOT_FOUND ERR_READ_BUFFER error = log.ERR_READ_BUFFER ERR_MORE_BUFFER error = log.ERR_MORE_BUFFER ERR_NO_SUPPORT error = log.ERR_NO_SUPPORT ERR_INVALID_INDEX error = log.ERR_INVALID_INDEX ERR_NO_INCLUDE_ROOT error = log.ERR_NO_INCLUDE_ROOT ERR_INVLIAD_WRITE_SIZE error = log.ERR_INVLIAD_WRITE_SIZE ERR_OVERWARP_DIFF error = errors.New("old diff is overwarap current dfff") )
var (
AlreadReadError = errors.New("read already")
)
var ( // tag for Marshal/Unmarshal FBS_TAG_NAME string = "fbs" )
var IdxNames []string = []string{}
var IsStructName map[string]bool = map[string]bool{}
var LogW io.Writer = os.Stderr
var Name2Idx map[string]int = map[string]int{}
var NameToType map[string]int = map[string]int{ "bool": TypeBool, "byte": TypeByte, "int8": TypeInt8, "int16": TypeInt16, "int32": TypeInt32, "int64": TypeInt64, "unt8": TypeUint8, "uint16": TypeUint16, "uint32": TypeUint32, "uint64": TypeUint64, "float32": TypeFloat32, "float64": TypeFloat64, "Bool": TypeBool, "Byte": TypeByte, "Int8": TypeInt8, "Int16": TypeInt16, "Int32": TypeInt32, "Int64": TypeInt64, "Unt8": TypeUint8, "Uint16": TypeUint16, "Uint32": TypeUint32, "Uint64": TypeUint64, "Float32": TypeFloat32, "Float64": TypeFloat64, }
var RootName string = ""
RootName undocumented
var TypeToGroup map[int]int = map[int]int{ TypeBool: FieldTypeBasic1, TypeByte: FieldTypeBasic1, TypeInt8: FieldTypeBasic1, TypeInt16: FieldTypeBasic2, TypeInt32: FieldTypeBasic4, TypeInt64: FieldTypeBasic8, TypeUint8: FieldTypeBasic1, TypeUint16: FieldTypeBasic2, TypeUint32: FieldTypeBasic4, TypeUint64: FieldTypeBasic8, TypeFloat32: FieldTypeBasic4, TypeFloat64: FieldTypeBasic8, }
var TypeToSize map[int]int = map[int]int{ TypeBool: 1, TypeByte: 1, TypeInt8: 1, TypeInt16: 2, TypeInt32: 4, TypeInt64: 8, TypeUint8: 1, TypeUint16: 2, TypeUint32: 4, TypeUint64: 8, TypeFloat32: 4, TypeFloat64: 8, }
var UnionAlias map[string][]string = map[string][]string{}
Functions ¶
func ApplyRequestNameFields ¶
func ApplyRequestNameFields()
func GetTypeGroup ¶
func HasNameType ¶
func IsFieldBasicType ¶
func IsFieldBytes ¶
func IsFieldSlice ¶
func IsFieldStruct ¶
func IsFieldTable ¶
func IsFieldUnion ¶
func IsMatchBit ¶
IsMatchBit ... is used bit field . mainly Field Type
func IsSameField ¶
func IsSameTable ¶
func IsUnionName ¶
func L2isEnable ¶ added in v0.2.3
func L2isEnable(param Log2Option) bool
func Log ¶
if no output , not eval args
Log(LOG_DEBUG, func() LogArgs { return F("test %d \n", 1) })
func Log2 ¶ added in v0.2.3
func Log2(opts ...Log2Option) (result interface{})
Log2 ... logger with lazy evaluation and filter mode
func NameToTypeEnum ¶
func NodeFieldSynmbol ¶
func SetIdxToName ¶
func SetIdxToType ¶
func SetL2Current ¶ added in v0.2.3
func SetLogLevel ¶
func SetLogLevel(l LogLevel)
func SetNameIsStrunct ¶
func SetNameToIdx ¶
func SetdxToTypeGroup ¶
func SymbolToNames ¶
func SymbolToString ¶
func VlensTotals ¶ added in v0.2.3
Types ¶
type BaseImpl ¶ added in v0.1.2
BaseImpl ... Base Object of byte buffer for flatbuffers read from r and store bytes. Diffs has jounals for writing
func NewBaseImpl ¶ added in v0.1.4
NewBaseImpl ... initialize BaseImpl struct via buffer(buf)
func NewBaseImplByIO ¶ added in v0.1.4
NewBaseImplByIO ... return new BaseImpl instance with io.Reader
func (*BaseImpl) ClearValueInfoOnDirty ¶ added in v0.1.2
ClearValueInfoOnDirty ... notify to be changed ValueInfo.
func (*BaseImpl) Flatten ¶ added in v0.1.2
func (b *BaseImpl) Flatten()
Flatten ... Diffs buffer join to bytes
func (*BaseImpl) FlattenWithLen ¶ added in v0.1.9
FlattenWithLen ... Diffs buffer join to bytes
func (*BaseImpl) HasIoReader ¶ added in v0.1.2
HasIoReader ... Base buffer is reading io.Reader or not.
func (*BaseImpl) Merge ¶ added in v0.1.2
func (b *BaseImpl) Merge()
Merge ... join Diffs buffer to bytes Deprecated: Use Flatten()
func (*BaseImpl) MergeDiffs ¶ added in v0.4.1
func (b *BaseImpl) MergeDiffs()
func (*BaseImpl) NewFromBytes ¶ added in v0.1.4
NewFromBytes ... return new BaseImpl instance with byte buffer
func (*BaseImpl) Next ¶ added in v0.1.2
Next ... provide next root flatbuffers this is mainly for streaming data.
func (*BaseImpl) R ¶ added in v0.1.2
R ... is access buffer data Base cannot access byte buffer directly.
func (*BaseImpl) ShouldCheckBound ¶ added in v0.1.2
ShouldCheckBound .. which check bounding of buffer.
type BufInfo ¶
type BufInfo [2]RawBufInfo
BufInfo is buffer detail infomation information of Base.bytes is stored to 0 indexed information of Base.Diffs is stored to 1 indexed
type CommonList ¶ added in v0.1.2
type CommonList struct { *CommonNode // contains filtered or unexported fields }
CommonList ... return List for separated data area.
func (*CommonList) Add ¶ added in v0.1.2
func (dst *CommonList) Add(src *CommonList) (nList *CommonList, e error)
Add ... if src.Name and dst.Name is the same and list, join header
only support element is table .
func (*CommonList) At ¶ added in v0.1.2
func (l *CommonList) At(i int) (*CommonNode, error)
At ... return Element of list
func (*CommonList) DataLen ¶ added in v0.1.2
func (l *CommonList) DataLen() int
DataLen ... return data.
func (*CommonList) DataWriter ¶ added in v0.1.2
func (l *CommonList) DataWriter() io.Writer
DataWriter ... return DataWriter
func (*CommonList) SetAt ¶ added in v0.1.2
func (l *CommonList) SetAt(i int, elm *CommonNode) error
SetAt ... Set Element to list
func (*CommonList) SetDataWriter ¶ added in v0.1.2
func (l *CommonList) SetDataWriter(w io.Writer)
SetDataWriter ... set io.Writer for writing data area.
func (*CommonList) VLen ¶ added in v0.1.4
func (l *CommonList) VLen() uint32
VLen ... return Len of Virtual Table.
func (*CommonList) WriteDataAll ¶ added in v0.1.2
func (l *CommonList) WriteDataAll() (e error)
WriteDataAll ... write all data to datawriter
func (*CommonList) WriteElm ¶ added in v0.1.2
func (l *CommonList) WriteElm(elm *CommonNode, pos, size int)
WriteElm ... Set Element to list
type CommonNode ¶
type CommonNode struct { *NodeList Name string IdxToType map[int]int IdxToTypeGroup map[int]int // contains filtered or unexported fields }
CommonNode ... is node of flatbuffers.
func FromBytes ¶
func FromBytes(bytes []byte) *CommonNode
FromBytes ... return fbs data for []byte Deprecated: use FromByteList()
func Open ¶
func Open(r io.Reader, cap int, opts ...Option) (node *CommonNode)
Open ... Open New CommonNode with io.Reader
func OpenByBuf ¶
func OpenByBuf(buf []byte, opts ...Option) *CommonNode
OpenByBuf ... Open New CommonNode with byte buffer
func (*CommonNode) CanFollow ¶
func (node *CommonNode) CanFollow(idx int) bool
CanFollow ... check instance on Union.
func (*CommonNode) CountOfField ¶
func (node *CommonNode) CountOfField() int
CountOfField ... return count of field/attribute
func (*CommonNode) DumpTableWithVTable ¶
func (node *CommonNode) DumpTableWithVTable() string
DumpTableWithVTable ... Dump flatbuffers Table and VTable information.
func (*CommonNode) Equal ¶ added in v0.1.9
func (n1 *CommonNode) Equal(n2 *CommonNode) bool
Equal ... return boolan if value is same.
func (*CommonNode) FieldAt ¶
func (node *CommonNode) FieldAt(idx int) (cNode *CommonNode)
FieldAt ... return field by field index
func (*CommonNode) FindTree ¶
func (node *CommonNode) FindTree(cond TreeCond) <-chan *Tree
FindTree ... return Tree by condtion function.
func (*CommonNode) FollowUnion ¶
func (node *CommonNode) FollowUnion(idx int) *CommonNode
FollowUnion ... return instance via Union.
func (*CommonNode) InRoot ¶
func (node *CommonNode) InRoot() bool
InRoot ... return true if buffer include Root Node.
func (*CommonNode) Info ¶
func (node *CommonNode) Info() (info Info)
Info ... return information of node
func (*CommonNode) InsertBuf ¶
func (node *CommonNode) InsertBuf(pos, size int)
InsertBuf ... insert buffer in pos position.
func (*CommonNode) InsertSpace ¶
func (node *CommonNode) InsertSpace(pos, size int, isInsert bool)
InsertSpace ... insert buffer in pos position.
func (*CommonNode) IsLeafAt ¶
func (node *CommonNode) IsLeafAt(j int) bool
IsLeafAt ... field has child or not.
func (*CommonNode) IsList ¶
func (node *CommonNode) IsList() bool
IsList ... return true if is List Node.
func (*CommonNode) IsRoot ¶
func (node *CommonNode) IsRoot() bool
IsRoot ... return true if root node.
func (*CommonNode) IsSameType ¶
func (node *CommonNode) IsSameType(idx int, fNode *CommonNode) bool
IsSameType ... return true if type information of field collect. FIXME: should improve for performance
func (*CommonNode) List ¶ added in v0.1.5
func (node *CommonNode) List() *List
List ... return List instance if node is List.
func (*CommonNode) RootCommon ¶
func (node *CommonNode) RootCommon() *CommonNode
RootCommon ... return Root Node.
func (*CommonNode) SearchInfo ¶
func (node *CommonNode) SearchInfo(pos int, fn RecFn, condFn CondFn)
SearchInfo ... collect Infomation via traversing. if TraverseInfo is work. removed
func (*CommonNode) SelfAsCommonNode ¶ added in v0.1.2
func (node *CommonNode) SelfAsCommonNode() *CommonNode
SelfAsCommonNode ... return self CommonNode used by trick genny.
func (*CommonNode) SetBool ¶
func (node *CommonNode) SetBool(v bool) error
func (*CommonNode) SetByte ¶
func (node *CommonNode) SetByte(v byte) error
func (*CommonNode) SetFieldAt ¶
func (node *CommonNode) SetFieldAt(idx int, fNode *CommonNode) error
SetFieldAt ... set Node to current Node field/attribute
func (*CommonNode) SetFloat32 ¶
func (node *CommonNode) SetFloat32(v float32) error
func (*CommonNode) SetFloat64 ¶
func (node *CommonNode) SetFloat64(v float64) error
func (*CommonNode) SetInt16 ¶
func (node *CommonNode) SetInt16(v int16) error
func (*CommonNode) SetInt32 ¶
func (node *CommonNode) SetInt32(v int32) error
func (*CommonNode) SetInt64 ¶
func (node *CommonNode) SetInt64(v int64) error
func (*CommonNode) SetInt8 ¶
func (node *CommonNode) SetInt8(v int8) error
func (*CommonNode) SetUint16 ¶
func (node *CommonNode) SetUint16(v uint16) error
func (*CommonNode) SetUint32 ¶
func (node *CommonNode) SetUint32(v uint32) error
func (*CommonNode) SetUint64 ¶
func (node *CommonNode) SetUint64(v uint64) error
func (*CommonNode) SetUint8 ¶
func (node *CommonNode) SetUint8(v uint8) error
func (*CommonNode) TraverseInfo ¶
func (node *CommonNode) TraverseInfo(pos int, fn TraverseRec, condFn TraverseCond)
TraverseInfo ... traverse Info/ValueInfo of all node.
func (*CommonNode) TraverseInfoSlice ¶
func (node *CommonNode) TraverseInfoSlice(pos int, fn TraverseRec, condFn TraverseCond)
TraverseInfoSlice ... traverse Info/ValueInfo of all list node.
func (*CommonNode) Unmarshal ¶
func (node *CommonNode) Unmarshal(v interface{}) error
Unmarshal ... unmarshal to struct. only work fbs's struct node.
func (*CommonNode) ValueInfo ¶
func (node *CommonNode) ValueInfo(idx int) ValueInfo
ValueInfo ... return infomation of field/attribute of node.
type Diff ¶
type Diff struct { Offset int // contains filtered or unexported fields }
Diff is journal for create/update
func (*Diff) MergeStable ¶ added in v0.4.1
MergeStable ... keep nodata hole
type DiffsIndexResult ¶ added in v0.4.1
type DiffsIndexResult struct {
// contains filtered or unexported fields
}
type DirectReader ¶ added in v0.1.2
type DirectReader struct { IO // contains filtered or unexported fields }
DirectReader ... is Base without buffer in data area
func NewDirectReader ¶ added in v0.1.2
func NewDirectReader(b IO, r io.ReaderAt) DirectReader
NewDirectReader ... return new DirectReader instance.
func (DirectReader) R ¶ added in v0.1.2
func (b DirectReader) R(offset int, opts ...OptIO) (result []byte)
R ... read data.
func (DirectReader) ShouldCheckBound ¶ added in v0.1.2
func (b DirectReader) ShouldCheckBound() bool
ShouldCheckBound ... DirectReader is not checking boundary.
type DoubleLayer ¶ added in v0.2.0
type DoubleLayer struct {
*BaseImpl
}
DoubleLayer is BaseImpl with Single Diff
func NewDoubleLayer ¶ added in v0.2.0
func NewDoubleLayer(b IO) DoubleLayer
NewDoubleLayer ... return DobuleLayer
func (DoubleLayer) Copy ¶ added in v0.2.0
func (b DoubleLayer) Copy(osrc IO, srcOff, size, dstOff, extend int)
func (DoubleLayer) D ¶ added in v0.2.0
func (b DoubleLayer) D(off, size int) *Diff
D ... return Diff for write
func (DoubleLayer) Dup ¶ added in v0.2.3
func (b DoubleLayer) Dup() (dst IO)
func (DoubleLayer) New ¶ added in v0.2.0
func (b DoubleLayer) New(n IO) IO
New ... return new NoLayer instance
func (DoubleLayer) NewFromBytes ¶ added in v0.2.0
func (b DoubleLayer) NewFromBytes(bytes []byte) IO
NewFromBytes ... return new NoLayer instance with byte buffer.
func (DoubleLayer) R ¶ added in v0.2.0
func (b DoubleLayer) R(off int, opts ...OptIO) []byte
R ... read buffer
func (DoubleLayer) Type ¶ added in v0.2.0
func (b DoubleLayer) Type() uint8
Type ... type of Base interface
func (DoubleLayer) U ¶ added in v0.2.0
func (b DoubleLayer) U(off, size int) []byte
U ... return buffer for update
type DumpOptFn ¶ added in v0.2.0
type DumpOptFn func(opt *DumpOpt)
func OptDumpOut ¶ added in v0.2.1
func OptDumpSize ¶ added in v0.2.0
type ErrorMustRead ¶ added in v0.4.1
func (ErrorMustRead) Error ¶ added in v0.4.1
func (e ErrorMustRead) Error() string
func (ErrorMustRead) ToParam ¶ added in v0.4.1
func (e ErrorMustRead) ToParam() (int, int)
type GlobalConfig ¶ added in v0.2.3
type GlobalConfig struct {
// contains filtered or unexported fields
}
var CurrentGlobalConfig GlobalConfig = GlobalConfig{/* contains filtered or unexported fields */}
type IO ¶ added in v0.4.1
type IO interface { Next(skip int) IO HasIoReader() bool R(off int, opts ...OptIO) []byte D(off, size int) *Diff C(off, size int, src []byte) error Copy(src IO, srcOff, size, dstOff, extend int) U(off, size int) []byte LenBuf() int Merge() // Deprecated: should use Flatten() Flatten() Dedup() ClearValueInfoOnDirty(node *NodeList) AddDirty(Dirty) GetDiffs() []Diff SetDiffs([]Diff) ShouldCheckBound() bool New(IO) IO NewFromBytes([]byte) IO Impl() *BaseImpl Type() uint8 Dump(int, ...DumpOptFn) string Dup() IO // for io interface Read([]byte) (int, error) ReadAt([]byte, int64) (int, error) Write(p []byte) (n int, err error) WriteAt([]byte, int64) (int, error) // contains filtered or unexported methods }
IO ... low level buffer
type Info ¶
type Info ValueInfo
Info is infotion of flatbuffer's table/struct
func FbsStringInfo ¶
FbsStringInfo ... return Node Infomation for FbsString
type List ¶ added in v0.1.4
type List CommonNode
List ... List Node as CommonNode.
func FromByteList ¶ added in v0.1.4
FromByteList ... []byte in flatbuffers.
func (*List) All ¶ added in v0.1.4
func (node *List) All() []*CommonNode
All ... All Element by condtion function
func (*List) At ¶ added in v0.1.4
func (node *List) At(i int) (*CommonNode, error)
At ... return Element of list
func (*List) AtWihoutError ¶ added in v0.2.3
func (node *List) AtWihoutError(i int) *CommonNode
AtWihoutError ... ignore error
func (*List) Find ¶ added in v0.1.4
func (node *List) Find(fn func(m *CommonNode) bool) *CommonNode
Find ... Find Element by condtion function
func (*List) First ¶ added in v0.1.4
func (node *List) First() (*CommonNode, error)
First ... First Element in List
func (*List) Last ¶ added in v0.1.4
func (node *List) Last() (*CommonNode, error)
Last ... Last Element in List
func (*List) New ¶ added in v0.2.99
New ... return new list
if ListOptionge was not set, return empty list if OptRange was set, return sub list by range
func (*List) SearchIndex ¶ added in v0.1.4
func (node *List) SearchIndex(n int, fn func(c *CommonNode) bool) int
SearchIndex ... binary search copy/modify from golang.org/src/sort/search.go
func (*List) SearchInfoSlice ¶ added in v0.1.4
SearchInfoSlice ... search list information
func (*List) Select ¶ added in v0.1.4
func (node *List) Select(fn func(m *CommonNode) bool) []*CommonNode
Select ... Select Elements by condtion function
func (*List) SelfAsCommonNode ¶ added in v0.1.4
func (node *List) SelfAsCommonNode() *CommonNode
SelfAsCommonNode ... return self CommonNode used by trick genny.
func (*List) SetAt ¶ added in v0.1.4
func (node *List) SetAt(idx int, elm *CommonNode) error
SetAt ... Set Element to list.
if elm type is variable length (examply Table). this operation is heavy. to add list , should use Add()
type ListOpt ¶ added in v0.2.99
type ListOpt func(*ListOption)
type ListOption ¶ added in v0.2.99
type ListOption struct {
// contains filtered or unexported fields
}
func DefaultListOpt ¶ added in v0.2.99
func DefaultListOpt() ListOption
type ListOpts ¶ added in v0.2.99
type ListOpts []ListOpt
func (ListOpts) Apply ¶ added in v0.2.99
func (opts ListOpts) Apply(opt *ListOption)
type Log2Option ¶ added in v0.2.3
type Log2Option func(*LogOptParam)
var ( L2_DEBUG_IS Log2Option = L2OptFlag(LOG_DEBUG, FLT_IS) L2_WARN_IS Log2Option = L2OptFlag(LOG_WARN, FLT_IS) L2_WARN_IO Log2Option = L2OptFlag(LOG_WARN, FLT_IO) L2_DEBUG_IO Log2Option = L2OptFlag(LOG_DEBUG, FLT_IO) )
func L2F ¶ added in v0.4.1
func L2F(fn func()) Log2Option
func L2OptF ¶ added in v0.2.3
func L2OptF(fn LogFn) Log2Option
func L2OptRun ¶ added in v0.2.3
func L2OptRun(fn func() L2Run) Log2Option
func L2fmt ¶ added in v0.2.3
func L2fmt(s string, vlist ...interface{}) Log2Option
type LogFmtParam ¶ added in v0.2.3
type LogFmtParam func() []interface{}
type LogOptParam ¶ added in v0.2.3
type LogOptParam struct {
// contains filtered or unexported fields
}
type NoLayer ¶ added in v0.1.2
type NoLayer struct {
*BaseImpl
}
NoLayer is BaseImpl without journal infomation for perfomance.
func NewNoLayer ¶ added in v0.1.2
NewNoLayer ... return new NoLayer instnace. b must be BaseImpl/NoLayer
func (NoLayer) NewFromBytes ¶ added in v0.1.4
NewFromBytes ... return new NoLayer instance with byte buffer.
type Node ¶
Node base struct. Pos is start position of buffer ValueInfos is information of pointted fields
func NewNode ¶
NewNode ... this provide creation of Node Node share buffer in same tree.
Base is buffer pos is start position in Base's buffer
func (*Node) BaseToNoLayer ¶ added in v0.1.2
func (node *Node) BaseToNoLayer()
func (*Node) Unmarshal ¶
func (node *Node) Unmarshal(ptr interface{}, setter UnmarshalFn) error
func (*Node) ValueInfoPosBytes ¶
ValueInfoPosBytes ... etching vtable position infomation for []byte
func (*Node) ValueInfoPosList ¶
ValueInfoPosList ... etching vtable position infomation for flatbuffers vector
func (*Node) ValueStruct ¶
func (*Node) ValueTable ¶
func (*Node) VirtualTable ¶
VirtualTable ... return VTable.
func (*Node) VirtualTableIsZero ¶
VirtualTableIsZero ... return checking VTable is empty
func (*Node) VirtualTableLen ¶
type OptGlobalConf ¶ added in v0.2.3
type OptGlobalConf func(*GlobalConfig)
func OptUseMovOff ¶ added in v0.2.3
func OptUseMovOff(t bool) OptGlobalConf
type OptionState ¶ added in v0.1.4
type OptionState struct {
// contains filtered or unexported fields
}
var DefaultOption OptionState = OptionState{ // contains filtered or unexported fields }
type ParamIO ¶ added in v0.4.1
type ParamIO struct {
// contains filtered or unexported fields
}
func NewParamOpt ¶ added in v0.4.1
type RawBufInfo ¶
RawBufInfo ... capacity/length infomation of Base's buffer
type ReaderAt ¶ added in v0.4.1
type ReaderAt struct {
// contains filtered or unexported fields
}
func NewReaderAt ¶ added in v0.4.1
type ReqestNameField ¶
type ReqestNameField struct { Names []string // contains filtered or unexported fields }
type Searcher ¶
type Searcher interface { SearchInfo(int, RecFn, CondFn) TraverseInfo(pos int, fn TraverseRec, condFn TraverseCond) }
type TraverseRec ¶
type TraverseRec func(*CommonNode, int, int, int, int)
type Tree ¶
type Tree struct { Node *CommonNode Parent *Tree Childs []*Tree }
Tree ... return node tree.