bbolt

package
v0.0.0-...-9276fa0 Latest Latest
Warning

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

Go to latest
Published: May 21, 2022 License: MIT Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseURL

func ParseURL(rawURL string) (path string, mode fs.FileMode, options *bolt.Options, e error)

bbolt://mode/path?k0=v0&k1=v1 bbolt://0600/bbolt.db?Timeout=1s bbolt://0600//bbolt.db?Timeout=1s

Types

type Option

type Option interface {
	// contains filtered or unexported methods
}

func WithDB

func WithDB(db *bolt.DB) Option

func WithLimit

func WithLimit(limit int64) Option

func WithURL

func WithURL(url string) Option

type Store

type Store struct {
	// contains filtered or unexported fields
}

func New

func New(opt ...Option) (s *Store, e error)

func (*Store) Close

func (s *Store) Close() (e error)

func (*Store) Del

func (s *Store) Del(ctx context.Context, key string) error

刪除數據

func (*Store) DelPrefix

func (s *Store) DelPrefix(ctx context.Context, prefix string) (err error)

刪除指定前綴的數據

func (*Store) Get

func (s *Store) Get(ctx context.Context, key string) (value []byte, err error)

返回數據

func (*Store) Put

func (s *Store) Put(ctx context.Context, key string, value []byte, deadline time.Time) (err error)

設置數據

func (*Store) Reset

func (s *Store) Reset() (err error)

清空所有 session

Jump to

Keyboard shortcuts

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