redux

package module
v0.1.11 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2025 License: AGPL-3.0 Imports: 12 Imported by: 34

README

redux

Documentation

Index

Constants

View Source
const (
	CaseSensitive = iota
	FullMatch
)

Variables

This section is empty.

Functions

func ErrUnknownAsset

func ErrUnknownAsset(asset string) error

Types

type MatchOption

type MatchOption int

type Readable

type Readable interface {
	MustHave(assets ...string) error
	Len(asset string) int
	Keys(asset string) iter.Seq[string]
	HasAsset(asset string) bool
	HasKey(asset, key string) bool
	HasValue(asset, key, val string) bool
	GetAllValues(asset, key string) ([]string, bool)
	GetLastVal(asset, key string) (string, bool)
	ParseLastValTime(asset, key string) (time.Time, bool, error)
	FileModTime() (int64, error)
	RefreshReader() (Readable, error)
	MatchAsset(asset string, terms []string, scope iter.Seq[string], options ...MatchOption) iter.Seq[string]
	Match(query map[string][]string, options ...MatchOption) iter.Seq[string]
	Sort(ids []string, desc bool, sortBy ...string) ([]string, error)
}

func NewReader

func NewReader(dir string, assets ...string) (Readable, error)

type Writeable

type Writeable interface {
	Readable
	AddValues(asset, key string, values ...string) error
	BatchAddValues(asset string, keyValues map[string][]string) error
	ReplaceValues(asset, key string, values ...string) error
	BatchReplaceValues(asset string, keyValues map[string][]string) error
	CutKeys(asset string, keys ...string) error
	CutValues(asset, key string, values ...string) error
	BatchCutValues(asset string, keyValues map[string][]string) error
	RefreshWriter() (Writeable, error)
}

func NewWriter

func NewWriter(dir string, assets ...string) (Writeable, error)

Jump to

Keyboard shortcuts

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