memory

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2021 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 value of the specified key or directory

func (*Memory) Incr

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

Atomic increase the specified key

func (*Memory) KeepAlive

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

Set and update ttl for the specified key

func (*Memory) Set

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

Set value with the specified key

func (*Memory) Type

func (p *Memory) Type() string

Return provider type

func (*Memory) Watch

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

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