keyvalue

package
v0.24.1 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2024 License: AGPL-3.0 Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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