keyvalue

package
v0.23.0 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2024 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecrBy

func DecrBy(key string, update int64) (err error)

DecrBy increases a value at key by the amount in update

func Del

func Del(key string) (err error)

Del removes a save value from a storage backend

func Get

func Get(key string) (value interface{}, exists bool, err error)

Get returns a value from a storage backend

func GetWithValue added in v0.18.0

func GetWithValue(key string, value interface{}) (exists bool, err error)

func IncrBy

func IncrBy(key string, update int64) (err error)

IncrBy increases a value at key by the amount in update

func InitStorage

func InitStorage()

InitStorage initializes the configured storage backend

func Put

func Put(key string, value interface{}) error

Put puts a value in the storage backend

Types

type Storage

type Storage interface {
	Put(key string, value interface{}) (err error)
	Get(key string) (value interface{}, exists bool, err error)
	GetWithValue(key string, value interface{}) (exists bool, err error)
	Del(key string) (err error)
	IncrBy(key string, update int64) (err error)
	DecrBy(key string, update int64) (err error)
}

Storage defines an interface for saving key-value pairs

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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