sqlitec

package
v0.1.30 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Migrations embed.FS

Migrations provide database migrations.

Functions

This section is empty.

Types

type DBMapOf added in v0.0.19

type DBMapOf[V any] struct {
	// contains filtered or unexported fields
}

DBMapOf is an in-memory cache backend. Please use NewDBMapOf to create it.

func NewDBMapOf added in v0.0.19

func NewDBMapOf[V any](st *sqluct.Storage, options ...func(cfg *cache.Config)) *DBMapOf[V]

NewDBMapOf creates an instance of in-memory cache with optional configuration.

func (DBMapOf) Delete added in v0.0.19

func (c DBMapOf) Delete(ctx context.Context, key []byte) error

Delete removes value by the key.

It fails with ErrNotFound if key does not exist.

func (DBMapOf) DeleteAll added in v0.0.19

func (c DBMapOf) DeleteAll(ctx context.Context)

DeleteAll erases all entries.

func (DBMapOf) ExpireAll added in v0.0.19

func (c DBMapOf) ExpireAll(ctx context.Context)

ExpireAll marks all entries as expired, they can still serve stale cache.

func (DBMapOf) Len added in v0.0.19

func (c DBMapOf) Len() int

Len returns number of elements in cache.

func (DBMapOf) Read added in v0.0.19

func (c DBMapOf) Read(ctx context.Context, key []byte) (val V, _ error)

Read gets value.

func (DBMapOf) Write added in v0.0.19

func (c DBMapOf) Write(ctx context.Context, k []byte, v V) error

Write sets value by the key.

type RecordOf added in v0.0.19

type RecordOf[V any] struct {
	Val sqluct.JSON[V] `db:"val" json:"val,omizero" title:"Value"`
	// contains filtered or unexported fields
}

type RecordOfByte added in v0.0.19

type RecordOfByte struct {
	Val []byte `db:"val" json:"val,omizero" title:"Value"`
	// contains filtered or unexported fields
}

type UnixTime added in v0.0.19

type UnixTime int64

Jump to

Keyboard shortcuts

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