database

package
v0.0.0-...-adeac23 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SnapshotKey

func SnapshotKey(kind string, id uuid.UUID) string

func UseLease

func UseLease(ctx context.Context) bool

func WithLease

func WithLease(ctx context.Context, use bool) context.Context

Types

type KeyValue

type KeyValue interface {
	Set(ctx context.Context, key string, value fmt.Stringer) error
	Get(ctx context.Context, key string, withPrefix bool) (map[string]string, bool)
	Delete(ctx context.Context, key string) error
	Keys(ctx context.Context) []string
	Close(ctx context.Context) error
	StartSession(ctx context.Context) error
	KeepAlive(ctx context.Context, callback func(any)) error
	EndSession(ctx context.Context) error
	Persist(ctx context.Context, key string, value Snapshot) error
	Restore(ctx context.Context, key string) (Snapshot, error)
}

type Snapshot

type Snapshot struct {
	Timestamp int64
	Data      []byte
}

func NewSnapshot

func NewSnapshot(data []byte) Snapshot

func (Snapshot) String

func (s Snapshot) String() string

type Store

type Store interface {
	Get(dest any, query string, args ...any) error
	Select(dest any, query string, args ...any) error
	NamedExec(query string, arg any) (sql.Result, error)
	Exec(query string, args ...any) (sql.Result, error)
	Beginx() (*sqlx.Tx, error)
}

type Stringerable

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

func ToStringerable

func ToStringerable(value string) Stringerable

func (Stringerable) String

func (s Stringerable) String() string

Directories

Path Synopsis
kv
store

Jump to

Keyboard shortcuts

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