Help us shape the future of Go! Take the 2026 Go Developer Survey

memorykv

package
v3.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Interval for the check
	Interval int
}

Config is default config for the in-memory driver

func (*Config) InitDefaults

func (c *Config) InitDefaults()

InitDefaults by default driver is turned off

type Configurer

type Configurer interface {
	// UnmarshalKey takes a single key and unmarshal it into a Struct.
	UnmarshalKey(name string, out any) error
	// Has checks if config section exists.
	Has(name string) bool
}

type Driver

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

func NewInMemoryDriver

func NewInMemoryDriver(key string, log *zap.Logger, cfgPlugin Configurer) (*Driver, error)

func (*Driver) Clear

func (d *Driver) Clear() error

func (*Driver) Delete

func (d *Driver) Delete(keys ...string) error

func (*Driver) Get

func (d *Driver) Get(key string) ([]byte, error)

func (*Driver) Has

func (d *Driver) Has(keys ...string) (map[string]bool, error)

func (*Driver) MExpire

func (d *Driver) MExpire(items ...*kvv1.Item) error

MExpire sets the expiration time to the key If key already has the expiration time, it will be overwritten

func (*Driver) MGet

func (d *Driver) MGet(keys ...string) (map[string][]byte, error)

func (*Driver) Set

func (d *Driver) Set(items ...*kvv1.Item) error

func (*Driver) Stop

func (d *Driver) Stop()

func (*Driver) TTL

func (d *Driver) TTL(keys ...string) (map[string]string, error)

Jump to

Keyboard shortcuts

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