bbolt

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2022 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 PineBolt

type PineBolt struct {
	*bolt.DB
	*Option
}

func New

func New(opt Option) *PineBolt

func (*PineBolt) BoltDB

func (b *PineBolt) BoltDB() *bolt.DB

func (*PineBolt) Delete

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

func (*PineBolt) Exists

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

func (*PineBolt) Get

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

func (*PineBolt) GetWithUnmarshal

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

func (*PineBolt) Set

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

func (*PineBolt) SetWithMarshal

func (b *PineBolt) 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