sqlitekvsloader

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeSQLite kvs.Type = "sqlite"
)

Variables

This section is empty.

Functions

func Load

func Load()

Types

type DBModel

type DBModel struct {
	RowID     int64
	K         string
	V         string
	UpdatedAt int64
}

type SQLiteKVS

type SQLiteKVS struct {
	*SQLiteKVSCfg
	// contains filtered or unexported fields
}

func NewSQLiteKVS

func NewSQLiteKVS() *SQLiteKVS

func (*SQLiteKVS) Close

func (s *SQLiteKVS) Close() error

func (*SQLiteKVS) Del

func (s *SQLiteKVS) Del(k string) error

func (*SQLiteKVS) GetCfg

func (s *SQLiteKVS) GetCfg() any

func (*SQLiteKVS) Load

func (s *SQLiteKVS) Load(k string) (any, bool, error)

func (*SQLiteKVS) LoadAll added in v0.1.0

func (s *SQLiteKVS) LoadAll() (map[string]any, error)

func (*SQLiteKVS) LoadAllAsString added in v0.1.0

func (s *SQLiteKVS) LoadAllAsString() (map[string]string, error)

func (*SQLiteKVS) LoadAndDelete

func (s *SQLiteKVS) LoadAndDelete(k string) (any, bool, error)

func (*SQLiteKVS) LoadAsBool

func (s *SQLiteKVS) LoadAsBool(k string) (bool, error)

func (*SQLiteKVS) LoadAsFloat

func (s *SQLiteKVS) LoadAsFloat(k string) (float64, error)

func (*SQLiteKVS) LoadAsFloatOr

func (s *SQLiteKVS) LoadAsFloatOr(k string, d float64) (float64, error)

func (*SQLiteKVS) LoadAsInt

func (s *SQLiteKVS) LoadAsInt(k string) (int, error)

func (*SQLiteKVS) LoadAsIntOr

func (s *SQLiteKVS) LoadAsIntOr(k string, d int) (int, error)

func (*SQLiteKVS) LoadAsString

func (s *SQLiteKVS) LoadAsString(k string) (string, error)

func (*SQLiteKVS) LoadAsStringOr

func (s *SQLiteKVS) LoadAsStringOr(k string, d string) (string, error)

func (*SQLiteKVS) LoadAsUint

func (s *SQLiteKVS) LoadAsUint(k string) (uint, error)

func (*SQLiteKVS) LoadAsUintOr

func (s *SQLiteKVS) LoadAsUintOr(k string, d uint) (uint, error)

func (*SQLiteKVS) LoadOrStore

func (s *SQLiteKVS) LoadOrStore(k string, v any) (any, bool, error)

func (*SQLiteKVS) Open

func (s *SQLiteKVS) Open() error

func (*SQLiteKVS) Range

func (s *SQLiteKVS) Range(f func(k string, v any) bool) error

func (*SQLiteKVS) Store

func (s *SQLiteKVS) Store(k string, v any) error

func (*SQLiteKVS) StoreAsString

func (s *SQLiteKVS) StoreAsString(k string, v any) error

func (*SQLiteKVS) Type

func (s *SQLiteKVS) Type() any

type SQLiteKVSCfg

type SQLiteKVSCfg struct {
	Path     string `json:"path"     yaml:"path" validate:"required"`
	Table    string `json:"table"    yaml:"table"`
	PoolSize int    `json:"poolSize" yaml:"poolSize"`
}

func NewSQLiteKVSCfg

func NewSQLiteKVSCfg() *SQLiteKVSCfg

Jump to

Keyboard shortcuts

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