memory

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewProvider

func NewProvider() backend.Provider

Types

type Memory

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

func (*Memory) Close

func (p *Memory) Close() error

Close the provider connection.

func (*Memory) Delete

func (p *Memory) Delete(key string, dir bool) error

Delete the specified key or directory.

func (*Memory) Get

func (p *Memory) Get(key string, dir bool) (backend.KVPairs, error)

Get the value of the specified key or directory.

func (*Memory) Incr

func (p *Memory) Incr(key string) (int64, error)

Incr invokes an atomic value increase for the specified key.

func (*Memory) KeepAlive

func (p *Memory) KeepAlive(key, value string, ttl time.Duration) error

KeepAlive sets value and updates the ttl for the specified key.

func (*Memory) Set

func (p *Memory) Set(key, value string, ttl time.Duration) error

Set value for the specified key with a specified ttl.

func (*Memory) Type

func (p *Memory) Type() string

Type returns the provider type.

func (*Memory) Watch

func (p *Memory) Watch(key string, dir bool) (backend.EventChan, error)

Watch for changes of the specified key or directory.

Jump to

Keyboard shortcuts

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