Documentation ¶
Index ¶
- Constants
- Variables
- func Decode(r io.Reader, val interface{}) error
- func DecodeBytes(b []byte, val interface{}) error
- func Encode(w io.Writer, val interface{}) error
- func EncodeSize(val interface{}) (int, error)
- func EncodeToBytes(val interface{}) ([]byte, error)
- func EncodeToReader(val interface{}) (size int, r io.Reader, err error)
- func LogObj(data interface{})
- type AccountName
- type ActionName
- type Carnivore
- type DataBase
- type DbHouse
- type DbIterator
- func (index *DbIterator) Begin() bool
- func (index *DbIterator) Data(data interface{}) error
- func (index *DbIterator) End() bool
- func (index *DbIterator) First() bool
- func (index *DbIterator) Key() []byte
- func (index *DbIterator) Last() bool
- func (index *DbIterator) Next() bool
- func (index *DbIterator) Prev() bool
- func (index *DbIterator) Release()
- func (index *DbIterator) Seek(key []byte) bool
- func (index *DbIterator) Value() []byte
- type DbResourceLimitsObject
- type DbTableIdObject
- type IdType
- type Iterator
- type LDataBase
- func (ldb *LDataBase) BeginIterator(begin, end, typeName []byte) (*DbIterator, error)
- func (ldb *LDataBase) Close()
- func (ldb *LDataBase) Commit(reversion int64)
- func (ldb *LDataBase) Empty(begin, end, fieldName []byte) bool
- func (ldb *LDataBase) EndIterator(begin, end, typeName []byte) (*DbIterator, error)
- func (ldb *LDataBase) Find(tagName string, in interface{}, out interface{}, skip ...SkipSuffix) error
- func (ldb *LDataBase) GetIndex(tagName string, in interface{}) (*MultiIndex, error)
- func (ldb *LDataBase) GetMutableIndex(fieldName string, in interface{}) (*MultiIndex, error)
- func (ldb *LDataBase) Insert(in interface{}) error
- func (ldb *LDataBase) IteratorTo(begin, end, fieldName []byte, data interface{}, skip ...SkipSuffix) (*DbIterator, error)
- func (ldb *LDataBase) LowerBound(begin, end, fieldName []byte, data interface{}, skip ...SkipSuffix) (*DbIterator, error)
- func (ldb *LDataBase) Modify(old interface{}, fn interface{}) error
- func (ldb *LDataBase) Remove(in interface{}) error
- func (ldb *LDataBase) Revision() int64
- func (ldb *LDataBase) SetRevision(reversion int64)
- func (ldb *LDataBase) Squash()
- func (ldb *LDataBase) StartSession() *Session
- func (ldb *LDataBase) Undo()
- func (ldb *LDataBase) UndoAll()
- func (ldb *LDataBase) UpperBound(begin, end, fieldName []byte, data interface{}, skip ...SkipSuffix) (*DbIterator, error)
- type MultiIndex
- func (index *MultiIndex) Begin() Iterator
- func (index *MultiIndex) BeginData(out interface{}) error
- func (index *MultiIndex) CompareBegin(in Iterator) bool
- func (index *MultiIndex) CompareEnd(in Iterator) bool
- func (index *MultiIndex) CompareIterator(it1 Iterator, it2 Iterator) bool
- func (index *MultiIndex) Empty() bool
- func (index *MultiIndex) End() Iterator
- func (index *MultiIndex) Find(in interface{}, out interface{}, skip ...SkipSuffix) error
- func (index *MultiIndex) IteratorTo(in interface{}) Iterator
- func (index *MultiIndex) LowerBound(in interface{}, skip ...SkipSuffix) (Iterator, error)
- func (index *MultiIndex) UpperBound(in interface{}, skip ...SkipSuffix) (Iterator, error)
- type Name
- type Pack
- type PermissionName
- type ScopeName
- type Session
- type SkipSuffix
- type TableName
Constants ¶
View Source
const ( INSERT = undoOperatorType(0) REMOVE = undoOperatorType(1) MODIFY = undoOperatorType(2) )
View Source
const ( MAX_NUM_ARRAY_ELEMENT = int(1024 * 1024) MAX_SIZE_OF_BYTE_ARRAYS = int(20 * 1024 * 1024) )
Variables ¶
View Source
var ( ErrNoID = errors.New("database : missing struct tag id field") ErrBadType = errors.New("database : provided data must be a struct or a pointer to struct") ErrAlreadyExists = errors.New("database : already exists") ErrIdNoSort = errors.New("database : The id field cannot use great or less") ErrTagInvalid = errors.New("database : Invalid tag") ErrIncompleteStructure = errors.New("database : Incomplete structure") ErrStructPtrNeeded = errors.New("database : provided target must be a pointer to struct") ErrPtrNeeded = errors.New("database : provided target must be a pointer to a valid variable") ErrNotFound = errors.New("database not found") )
Errors
View Source
var ( EOL = errors.New("rlp: end of list") ErrUnPointer = errors.New("rlp: interface given to Decode must be a pointer") ErrElemTooLarge = errors.New("rlp: element is larger than containing list") ErrValueTooLarge = errors.New("rlp: value size exceeds available input length") ErrVarIntBufferSize = errors.New("rlp: invalid buffer size") )
View Source
var TypeSize = struct { Bool int Byte int UInt8 int Int8 int UInt16 int Int16 int UInt32 int Int32 int UInt int Int int UInt64 int Int64 int SHA256Bytes int PublicKey int Signature int }{ Bool: 1, Byte: 1, UInt8: 1, Int8: 1, UInt16: 2, Int16: 2, UInt32: 4, Int32: 4, UInt: 4, Int: 4, UInt64: 8, Int64: 8, SHA256Bytes: 32, PublicKey: 34, Signature: 66, }
Functions ¶
func DecodeBytes ¶
func EncodeSize ¶
func EncodeToBytes ¶
Types ¶
type AccountName ¶
type AccountName uint64
type ActionName ¶
type ActionName uint64
type Carnivore ¶
type Carnivore struct { Lion int `multiIndex:"orderedUnique,less"` Tiger int `multiIndex:"orderedUnique,less"` }
///////////////////////////////////////////////////// test struct ///////////////////////////////////////////
type DataBase ¶
type DataBase interface { Close() Insert(in interface{}) error Find(tagName string, in interface{}, out interface{}, skip ...SkipSuffix) error Empty(begin, end, fieldName []byte) bool GetIndex(tagName string, in interface{}) (*MultiIndex, error) GetMutableIndex(tagName string, in interface{}) (*MultiIndex, error) Modify(data interface{}, fn interface{}) error Remove(data interface{}) error Undo() UndoAll() StartSession() *Session Commit(revision int64) SetRevision(revision int64) Revision() int64 LowerBound(key, value, typeName []byte, in interface{}, skip ...SkipSuffix) (*DbIterator, error) UpperBound(key, value, typeName []byte, in interface{}, skip ...SkipSuffix) (*DbIterator, error) IteratorTo(begin, end, fieldName []byte, in interface{}, skip ...SkipSuffix) (*DbIterator, error) BeginIterator(begin, end, typeName []byte) (*DbIterator, error) Squash() EndIterator(begin, end, typeName []byte) (*DbIterator, error) }
type DbIterator ¶
type DbIterator struct {
// contains filtered or unexported fields
}
Do not use the functions in this file
func (*DbIterator) Begin ¶
func (index *DbIterator) Begin() bool
func (*DbIterator) Data ¶
func (index *DbIterator) Data(data interface{}) error
func (*DbIterator) End ¶
func (index *DbIterator) End() bool
func (*DbIterator) First ¶
func (index *DbIterator) First() bool
func (*DbIterator) Key ¶
func (index *DbIterator) Key() []byte
func (*DbIterator) Last ¶
func (index *DbIterator) Last() bool
func (*DbIterator) Next ¶
func (index *DbIterator) Next() bool
func (*DbIterator) Prev ¶
func (index *DbIterator) Prev() bool
func (*DbIterator) Release ¶
func (index *DbIterator) Release()
func (*DbIterator) Seek ¶
func (index *DbIterator) Seek(key []byte) bool
func (*DbIterator) Value ¶
func (index *DbIterator) Value() []byte
type DbResourceLimitsObject ¶
type DbTableIdObject ¶
type DbTableIdObject struct { ID IdType `multiIndex:"id,increment,byScope"` Code AccountName `multiIndex:"orderedUnique,less"` Scope ScopeName `multiIndex:"byTable,orderedUnique,less:byScope,orderedUnique,less"` Table TableName `multiIndex:"byTable,orderedUnique,less"` Payer AccountName `multiIndex:"byScope,orderedUnique"` Count uint32 }
type Iterator ¶
type Iterator interface { Data(data interface{}) error End() bool Begin() bool // contains filtered or unexported methods }
Do not use the functions in this file
type LDataBase ¶
type LDataBase struct {
// contains filtered or unexported fields
}
func (*LDataBase) BeginIterator ¶
func (ldb *LDataBase) BeginIterator(begin, end, typeName []byte) (*DbIterator, error)
func (*LDataBase) EndIterator ¶
func (ldb *LDataBase) EndIterator(begin, end, typeName []byte) (*DbIterator, error)
func (*LDataBase) Find ¶
func (ldb *LDataBase) Find(tagName string, in interface{}, out interface{}, skip ...SkipSuffix) error
func (*LDataBase) GetIndex ¶
func (ldb *LDataBase) GetIndex(tagName string, in interface{}) (*MultiIndex, error)
@param tagName --> tag in field tags @param in --> object
@return success --> iterator error --> error
func (*LDataBase) GetMutableIndex ¶
func (ldb *LDataBase) GetMutableIndex(fieldName string, in interface{}) (*MultiIndex, error)
func (*LDataBase) IteratorTo ¶
func (ldb *LDataBase) IteratorTo(begin, end, fieldName []byte, data interface{}, skip ...SkipSuffix) (*DbIterator, error)
func (*LDataBase) LowerBound ¶
func (ldb *LDataBase) LowerBound(begin, end, fieldName []byte, data interface{}, skip ...SkipSuffix) (*DbIterator, error)
func (*LDataBase) SetRevision ¶
func (*LDataBase) StartSession ¶
func (*LDataBase) UpperBound ¶
func (ldb *LDataBase) UpperBound(begin, end, fieldName []byte, data interface{}, skip ...SkipSuffix) (*DbIterator, error)
type MultiIndex ¶
type MultiIndex struct {
// contains filtered or unexported fields
}
func (*MultiIndex) Begin ¶
func (index *MultiIndex) Begin() Iterator
func (*MultiIndex) BeginData ¶
func (index *MultiIndex) BeginData(out interface{}) error
func (*MultiIndex) CompareBegin ¶
func (index *MultiIndex) CompareBegin(in Iterator) bool
func (*MultiIndex) CompareEnd ¶
func (index *MultiIndex) CompareEnd(in Iterator) bool
func (*MultiIndex) CompareIterator ¶
func (index *MultiIndex) CompareIterator(it1 Iterator, it2 Iterator) bool
func (*MultiIndex) Empty ¶
func (index *MultiIndex) Empty() bool
func (*MultiIndex) End ¶
func (index *MultiIndex) End() Iterator
func (*MultiIndex) Find ¶
func (index *MultiIndex) Find(in interface{}, out interface{}, skip ...SkipSuffix) error
func (*MultiIndex) IteratorTo ¶
func (index *MultiIndex) IteratorTo(in interface{}) Iterator
func (*MultiIndex) LowerBound ¶
func (index *MultiIndex) LowerBound(in interface{}, skip ...SkipSuffix) (Iterator, error)
func (*MultiIndex) UpperBound ¶
func (index *MultiIndex) UpperBound(in interface{}, skip ...SkipSuffix) (Iterator, error)
type PermissionName ¶
type PermissionName uint64
Click to show internal directories.
Click to hide internal directories.