contract

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2026 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 Backend

type Backend interface {
	Get(key string) ([]byte, bool, error)

	Set(key string, payload []byte, ttl time.Duration) error

	Delete(key string) error

	Has(key string) (bool, error)

	Clear() error

	Many(keys []string) (map[string][]byte, error)

	SetMultiple(items map[string][]byte, ttl time.Duration) error

	DeleteMultiple(keys []string) error

	Increment(key string, delta int64) (int64, error)

	Decrement(key string, delta int64) (int64, error)

	Close() error
}

type Cache

type Cache interface {
	Get(key string) (any, bool, error)

	Set(key string, value any, ttl time.Duration) error

	Delete(key string) error

	Has(key string) (bool, error)

	Clear() error

	Many(keys []string) (map[string]any, error)

	SetMultiple(items map[string]any, ttl time.Duration) error

	DeleteMultiple(keys []string) error

	Increment(key string, delta int64) (int64, error)

	Decrement(key string, delta int64) (int64, error)

	Close() error
}

type Serializer

type Serializer interface {
	Serialize(value any) ([]byte, error)

	Deserialize(payload []byte) (any, error)
}

Jump to

Keyboard shortcuts

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