Documentation ¶ Index ¶ Constants type Txn func NewTxn(path string) (*Txn, error) func (txns *Txn) Close() func (tsns *Txn) Delete(key []byte) error func (txns *Txn) Get(key []byte) ([]byte, error) func (txns *Txn) GetStr(key []byte) (string, error) func (tsns *Txn) Set(key, value []byte) error func (tsns *Txn) SetWithTTL(key, value []byte, ttl time.Duration) error Constants ¶ View Source const ( TTL = 24 * time.Hour ) Variables ¶ This section is empty. Functions ¶ This section is empty. Types ¶ type Txn ¶ type Txn struct { Db *badger.DB } func NewTxn ¶ func NewTxn(path string) (*Txn, error) func (*Txn) Close ¶ func (txns *Txn) Close() func (*Txn) Delete ¶ func (tsns *Txn) Delete(key []byte) error func (*Txn) Get ¶ func (txns *Txn) Get(key []byte) ([]byte, error) func (*Txn) GetStr ¶ func (txns *Txn) GetStr(key []byte) (string, error) func (*Txn) Set ¶ func (tsns *Txn) Set(key, value []byte) error func (*Txn) SetWithTTL ¶ func (tsns *Txn) SetWithTTL(key, value []byte, ttl time.Duration) error Source Files ¶ View all Source files tnx-test.go tnx.go Click to show internal directories. Click to hide internal directories.