memory

package
v2.3.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const PluginName = "memory"

PluginName is user friendly name for the plugin

Variables

This section is empty.

Functions

func NewInMemoryDriver

func NewInMemoryDriver(log logger.Logger, key string, cfgPlugin config.Configurer, stop chan struct{}) (kv.Storage, error)

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 Driver

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

func (*Driver) Delete

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

func (*Driver) Get

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

func (*Driver) Has

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

func (*Driver) MExpire

func (s *Driver) MExpire(items ...kv.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 (s *Driver) MGet(keys ...string) (map[string]interface{}, error)

func (*Driver) Set

func (s *Driver) Set(items ...kv.Item) error

func (*Driver) TTL

func (s *Driver) TTL(keys ...string) (map[string]interface{}, error)

type Plugin

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

func (*Plugin) Available added in v2.2.0

func (s *Plugin) Available()

Available interface implementation

func (*Plugin) Init

func (s *Plugin) Init(cfg config.Configurer, log logger.Logger) error

func (*Plugin) Name

func (s *Plugin) Name() string

Name returns plugin user-friendly name

func (*Plugin) Provide

func (s *Plugin) Provide(key string) (kv.Storage, error)

func (*Plugin) Serve

func (s *Plugin) Serve() chan error

func (*Plugin) Stop

func (s *Plugin) Stop() error

Jump to

Keyboard shortcuts

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