Documentation ¶
Index ¶
- Constants
- type ArrayCursor
- type Attachment
- type Bucket
- type Codec
- type Collection
- type Cond
- type Cursor
- type Database
- type Driver
- type Expr
- type Index
- type Iterator
- type MapCursor
- func (c *MapCursor) First() (key []byte, value []byte)
- func (c MapCursor) Get(key []byte) []byte
- func (c *MapCursor) Next() (key []byte, value []byte)
- func (c *MapCursor) Prev() (key []byte, value []byte)
- func (c *MapCursor) Put(key, value []byte)
- func (c *MapCursor) Seek(seek []byte) (key []byte, value []byte)
- func (c MapCursor) This() ([]byte, []byte)
- type MatchCursor
- type MatchFunc
- type Op
- type Path
- type Permission
- type Query
- type Storage
- type SubstituteCursor
- type SubstituteFunc
- type Tx
- type Where
Constants ¶
const PathSeparator = "/"
PathSeparator is used to separate parts of paths to buckets.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArrayCursor ¶
type ArrayCursor struct {
// contains filtered or unexported fields
}
ArrayCursor implements the cursor interface using a backing array. The keys are little-endian binary encoded uint64 values of the array index. This type is probably most useful fot testing and simulating a key/value store.
func NewArrayCursor ¶
func NewArrayCursor(values [][]byte) *ArrayCursor
func (*ArrayCursor) First ¶
func (c *ArrayCursor) First() (key []byte, value []byte)
func (*ArrayCursor) Next ¶
func (c *ArrayCursor) Next() (key []byte, value []byte)
func (*ArrayCursor) Prev ¶
func (c *ArrayCursor) Prev() (key []byte, value []byte)
func (ArrayCursor) This ¶
func (c ArrayCursor) This() (key []byte, value []byte)
type Attachment ¶
type Attachment struct {
Collection `json:"collection"`
}
type Codec ¶
type Codec interface { Encode(decoded interface{}, options ...interface{}) ([]string, error) Decode(decoded interface{}, encoded []byte) error }
Codec is used to encode and decode data stored in and loaded from a collection
type Collection ¶
type Collection struct { // Path to the bucket this collection is stored in. Path string `json:"path"` // Name of codec to use to store and retrieve the data. CodecName string `json:"codec_name"` // Indexes on this collection. Indexes map[string]Index `json:"indexes"` // Attachment sub-collection for this collection. *Attachment `json:"attachment,omitempty"` // Permission sub-collection for this collection. *Permission `json:"permission,omitempty"` }
Collections is a group of similar documents stored together. Normally these are stored as JSON documents, but the data may also be encrypted, or binary for attachments.
All normal collections use a ULID as their key and a JSON document as their value. ULID makes creation timestamps redundant. All normal collection documents should have.
Attachments use a ULID for their key and the binary data prefixed with name and mime string as their value.
Permissions are keyed by ozner ¶
Indexes use the indexed value of one or more documents as their key, and the binary ulids of the documents that match that index value as their value. Since binary ULID is fixed length this simplifies index lookup.
type Database ¶
type Database struct { Storage `json:"-"` Collections map[string]Collection `json:"collections"` }
type Index ¶
type Index struct { Collection `json:"collection"` Unique bool `json:unique` Fulltext bool `json:fulltext` }
An index is a sub-collection of a collection where indices are stored to speed up looking up data in a collection.
type MapCursor ¶
type MapCursor struct {
// contains filtered or unexported fields
}
MapCursor implements the cursor infterface using a backing map. The keys are strings, the values binary. This type is probably most useful for testing and simulating a key/value store.
func NewMapCursor ¶
type MatchCursor ¶
type MatchCursor struct { MatchFunc // contains filtered or unexported fields }
MatchCursor applies a boolean match function on an underlying cursor and only iterates over or seeks values that match.
func NewMatchCursor ¶
func NewMatchCursor(underlying Cursor, f MatchFunc) *MatchCursor
func (*MatchCursor) Next ¶
func (c *MatchCursor) Next() ([]byte, []byte)
func (*MatchCursor) Prev ¶
func (c *MatchCursor) Prev() (key []byte, value []byte)
type MatchFunc ¶
MatchFunc returns true if the key and value "match" and should be kept, or false if they are not needed.
type Permission ¶
type Permission struct {
Collection `json:"collection"`
}
type Query ¶
type Query struct { Collection // contains filtered or unexported fields }
func Select ¶
func Select(c Collection) *Query
type SubstituteCursor ¶
type SubstituteCursor struct { SubstituteFunc // contains filtered or unexported fields }
SubstituteCursor applies a substitution filter on an underlying cursor and iterates over or seeks values with that substitution applied. This could be useful for instance for only returning a part of the document.
func (*SubstituteCursor) Next ¶
func (c *SubstituteCursor) Next() (key []byte, value []byte)
func (*SubstituteCursor) Prev ¶
func (c *SubstituteCursor) Prev() (key []byte, value []byte)
type SubstituteFunc ¶
SubstituteFunc returns the value that should be used in stead of the original value. This may also be nil. The key is not subsituted. This may be useful, for instamcem for decrypting encrypted documents.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
driver
|
|
bbolt-driver
Package bbolt-driver implements a bbolt driver for jidoco
|
Package bbolt-driver implements a bbolt driver for jidoco |
interface
|
|