bbolt

package
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 29, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry

type Entry struct {
	LifeTime time.Time `json:"life_time"`
	Val      string    `json:"val"`
}

type Option

type Option struct {
	TTL             int // sec
	Path            string
	Prefix          string
	BucketName      string
	BoltOpt         *bolt.Options
	CleanupInterval int
}

type PineBoltdb

type PineBoltdb struct {
	*bolt.DB
	*Option
}

func New

func New(opt Option) *PineBoltdb

func (*PineBoltdb) Delete

func (b *PineBoltdb) Delete(key string) error

func (*PineBoltdb) Exists

func (b *PineBoltdb) Exists(key string) bool

func (*PineBoltdb) Get

func (b *PineBoltdb) Get(key string) (val []byte, err error)

func (*PineBoltdb) GetBoltDB

func (b *PineBoltdb) GetBoltDB() *bolt.DB

func (*PineBoltdb) GetWithUnmarshal

func (b *PineBoltdb) GetWithUnmarshal(key string, receiver interface{}) error

func (*PineBoltdb) Set

func (b *PineBoltdb) Set(key string, val []byte, ttl ...int) error

func (*PineBoltdb) SetWithMarshal

func (b *PineBoltdb) SetWithMarshal(key string, structData interface{}, ttl ...int) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL