Documentation ¶
Index ¶
- Constants
- type Blum
- type Index
- type Mark
- type Query
- type Spec
- type Storage
- type Structer
- func (e *Structer) Add(item interface{}) error
- func (e *Structer) AddUnsafe(item interface{}) error
- func (e *Structer) Count() int
- func (e *Structer) Del(id string) error
- func (e *Structer) Find() *Query
- func (e *Structer) Fragmentation() int
- func (e *Structer) Get(id string) interface{}
- func (e *Structer) Revision() error
- func (e *Structer) Save(path string) error
- func (e *Structer) Update(itemNew interface{}) error
- type Tags
Constants ¶
const ( ASC = iota DESC )
Sorting the search result
const ( RESERVED_SIZE_FOR_TAGS int = 10 HOW_MANY_STRUCT_RETURN int = 20 )
Query defailt
const ( TYPE_INT = iota TYPE_INT32 TYPE_INT64 TYPE_UINT TYPE_UINT32 TYPE_UINT64 TYPE_FLOAT32 TYPE_FLOAT64 )
For spec
const RESERVED_SIZE_SLICE int = 100
RESERVED_SIZE_SLICE - default slice size
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Query ¶
type Query struct {
// contains filtered or unexported fields
}
Query - form a query to the database
type Structer ¶
Structer - a structures storage
func New ¶
New - create a new Structer item - это образец хранящейся структуры id - имя поля, которое будет id это поле должно быть строковым) tags - список тегов, это должны быть только int, string, []string поля структуры из по int полям можно будет потом сортировать, а по string и []string делать запросы на выборки.
func (*Structer) Add ¶
Add - add structure to storage This function is unsafe, since the user "outside" can change or delete the structure, and the database will not know anything about it.
func (*Structer) Fragmentation ¶
Fragmentation - percentage of fragmentation, the ratio of the unfragmented amount to the total.