Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FieldTranslator ¶
type FieldTranslator struct {
// contains filtered or unexported fields
}
FieldTranslator is a pdk.FieldTranslator which uses leveldb.
func NewFieldTranslator ¶
func NewFieldTranslator(dirname string, field string) (*FieldTranslator, error)
NewFieldTranslator creates a new FieldTranslator which uses LevelDB as backing storage.
func (*FieldTranslator) Close ¶
func (lft *FieldTranslator) Close() error
Close closes the two leveldbs used by the FieldTranslator.
func (*FieldTranslator) Get ¶
func (lft *FieldTranslator) Get(id uint64) (val interface{}, err error)
Get returns the value mapped to the given id.
func (*FieldTranslator) GetID ¶
func (lft *FieldTranslator) GetID(val interface{}) (id uint64, err error)
GetID returns the integer id associated with the given value. It allocates a new ID if the value is not found.
type Translator ¶
type Translator struct {
// contains filtered or unexported fields
}
Translator is a pdk.Translator which stores the two way val/id mapping in leveldb.
func NewTranslator ¶
func NewTranslator(dirname string, fields ...string) (lt *Translator, err error)
NewTranslator gets a new Translator.
func (*Translator) Close ¶
func (lt *Translator) Close() error
Close closes all of the underlying leveldb instances.
Click to show internal directories.
Click to hide internal directories.