storage

package
v0.7.4 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Opt

type Opt struct {
	// contains filtered or unexported fields
}

type OptFunc

type OptFunc func(*Opt)

func OptPos

func OptPos(pos uint64) OptFunc

func OptTTL

func OptTTL(ttl int) OptFunc

type PosStorage

type PosStorage[T any] interface {
	Storage[T]

	SetUInt64(v uint64) error
	GetUInt64() (v uint64, err error)
}

func NewWPos

func NewWPos[T any](dir, posKey string) PosStorage[T]

type Storage

type Storage[T any] interface {
	Set(k string, v T, opts ...OptFunc) error
	Get(k string) (v T, err error)
	Delete(k string, opts ...OptFunc) error
}

func New

func New[T any](dir string) Storage[T]

Jump to

Keyboard shortcuts

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