entry

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry

type Entry[T, K, V any] struct {
	// contains filtered or unexported fields
}

func New

func New[T, K, V any](sp Spec[T, K, V], key K) *Entry[T, K, V]

func (*Entry[T, K, V]) Get

func (ent *Entry[T, K, V]) Get(ctx context.Context) (*T, error)

func (*Entry[T, K, V]) Set

func (ent *Entry[T, K, V]) Set(ctx context.Context, v T) error

type Spec

type Spec[T, K, V any] interface {
	Get(context.Context, K) (*V, error)
	Set(context.Context, K, V) error
	Decode(V) (T, error)
	Encode(T) (V, error)
}

Jump to

Keyboard shortcuts

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