foxdb

package
v0.0.0-...-b414e3b Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2026 License: GPL-3.0 Imports: 10 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrKVNotFound = errors.New("not found")
)

Functions

func CreateDataCache

func CreateDataCache[T any](
	key string, cronSpec string, retrieve func() (T, error),
) *dataCache[T]

func GetKV

func GetKV[T any](store *KeyValueStore, key string) (T, error)

func InitDataCache

func InitDataCache(
	database *bun.DB, table string, dataCaches []DataCache,
) error

func PutKV

func PutKV[T any](store *KeyValueStore, key string, value T) error

Types

type DataCache

type DataCache interface {
	// contains filtered or unexported methods
}

type KeyValueStore

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

func InitKeyValue

func InitKeyValue(database *bun.DB, table string) (*KeyValueStore, error)

type TableFile

type TableFile struct {
	bun.BaseModel `bun:"table:files,alias:f"`
	Name          string    `bun:"name,pk"`
	Data          []byte    `bun:"data"`
	Created       time.Time `bun:"created,nullzero,notnull,default:current_timestamp"`
	// contains filtered or unexported fields
}

func (*TableFile) Close

func (file *TableFile) Close() error

func (*TableFile) Read

func (file *TableFile) Read(out []byte) (int, error)

func (*TableFile) Stat

func (file *TableFile) Stat() (fs.FileInfo, error)

type TableFiles

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

func InitTableFiles

func InitTableFiles(database *bun.DB, table string) (*TableFiles, error)

func (*TableFiles) Open

func (files *TableFiles) Open(name string) (fs.File, error)

func (*TableFiles) ReadFile

func (files *TableFiles) ReadFile(name string) ([]byte, error)

more effecient than fs.Read

func (*TableFiles) WriteFile

func (files *TableFiles) WriteFile(name string, data []byte) (fs.File, error)

Jump to

Keyboard shortcuts

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