memory

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Record

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

func NewRecord

func NewRecord(key string, value interface{}, expiry ...time.Duration) *Record

func (*Record) CheckState

func (r *Record) CheckState() bool

func (*Record) Expiry

func (r *Record) Expiry() time.Duration

func (*Record) Key

func (r *Record) Key() string

func (*Record) Time

func (r *Record) Time() time.Time

func (*Record) Value

func (r *Record) Value() interface{}

type Store

type Store struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

内存数据存储

func NewStore

func NewStore() *Store

NewStore returns a new store.Store

func (*Store) Bool

func (ms *Store) Bool(key string) (bool, error)

func (*Store) Delete

func (ms *Store) Delete(keys ...string) error

func (*Store) Get

func (ms *Store) Get(key string) (interface{}, error)

func (*Store) Int

func (ms *Store) Int(key string) (int, error)

func (*Store) Int32

func (ms *Store) Int32(key string) (int32, error)

func (*Store) Int64

func (ms *Store) Int64(key string) (int64, error)

func (*Store) List

func (ms *Store) List() ([]*Record, error)

func (*Store) Read

func (ms *Store) Read(keys ...string) ([]*Record, error)

func (*Store) Set

func (ms *Store) Set(key string, value interface{}, expiry ...time.Duration) error

func (*Store) Uint32

func (ms *Store) Uint32(key string) (uint32, error)

func (*Store) Uint64

func (ms *Store) Uint64(key string) (uint64, error)

func (*Store) Write

func (ms *Store) Write(records ...*Record) error

Jump to

Keyboard shortcuts

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