kv

package
v0.0.0-...-414c732 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Unknown kvTypeEnum = iota
	Redis
	Memcache
)

Variables

This section is empty.

Functions

func NewMemcacheModule

func NewMemcacheModule(
	server, username, password string,
) (container.Module, error)

func NewRedisModule

func NewRedisModule(uri string) (container.Module, error)

Types

type KV

type KV interface {
	Disconnect() error

	Get(ctx context.Context, key string) (string, error)
	Set(ctx context.Context, key, value string) error
	Expire(ctx context.Context, key string, timeout time.Duration) error

	Inc(ctx context.Context, key string) (int64, error)
}

func Establish

func Establish(module container.Module) (KV, error)

func NewMemcache

func NewMemcache(server, username, password string) (KV, error)

func NewRedis

func NewRedis(url string) (KV, error)

Jump to

Keyboard shortcuts

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