Documentation
¶
Index ¶
- Variables
- func Contains[V Tableable](db *DB, name string, v V) bool
- func Delete[V Tableable](db *DB, name string, value V) error
- func Get[V Tableable](db *DB, name string, v V) (*V, error)
- func GetOrSet[V Tableable](db *DB, name string, value V) (*V, error)
- func GetPrimaryKey[V any](v V) (string, any, error)
- func GetUniqueValues[V any](v V) (map[string]any, error)
- func Iter[V Tableable](db *DB, name string) func(yield func(any, *V) bool)
- func LoadTable[V Tableable](db *DB, name string, dir string) error
- func Lookup[V Tableable](db *DB, name string, index string, v V) (*V, error)
- func MarshalJSONPointer[T any](p T) ([]byte, error)
- func MustGet[V Tableable](db *DB, name string, v V) *V
- func Register[V Tableable](db *DB, name string, table table[V]) error
- func SaveTable[V Tableable](db *DB, name string, dir string) error
- func Set[V Tableable](db *DB, name string, value V) (*V, error)
- func UnmarshalJSONPointer[V any](b []byte, p *V) error
- func Update[V Tableable](db *DB, name string, value V) (*V, error)
- func Upsert[V Tableable](db *DB, name string, value V) (*V, error)
- type DB
- type Index
- type Indexable
- type Map
- func (m *Map[K, V]) Contains(key K) bool
- func (m *Map[K, V]) Delete(key K)
- func (m *Map[K, V]) Len() int
- func (m *Map[K, V]) Load(key K) (V, bool)
- func (m *Map[K, V]) LoadAndDelete(key K) (V, bool)
- func (m *Map[K, V]) LoadOrStore(key K, value V) (V, bool)
- func (m *Map[K, V]) Range(f func(K, V) bool)
- func (m *Map[K, V]) SortedRange(f func(K, V) bool)
- func (m *Map[K, V]) Store(key K, value V)
- func (m *Map[K, V]) StoreAndReturn(key K, value V) V
- type Persistent
- type SimpleIndex
- type Sort
- type Table
- func (t *Table[V]) AddIndex(key string, index Index[V])
- func (t *Table[V]) AddSort(key string, fn func(a, b *V) int)
- func (t *Table[V]) Contains(v V) bool
- func (t *Table[V]) Delete(key V) bool
- func (t *Table[V]) Get(v V) *V
- func (t *Table[V]) Iter() func(yield func(any, *V) bool)
- func (t *Table[V]) Len() int
- func (t *Table[V]) Load(paths ...string) error
- func (t *Table[V]) Lookup(name string, v V) *V
- func (t *Table[V]) Reindex(name string) error
- func (t *Table[V]) Resort(name string)
- func (t *Table[V]) Save(path string) error
- func (t *Table[V]) Set(value V) *V
- type Tableable
Constants ¶
This section is empty.
Variables ¶
View Source
var Default = NewDB()
Functions ¶
func MarshalJSONPointer ¶
func UnmarshalJSONPointer ¶
Types ¶
type Map ¶
type Map[K comparable, V any] struct { // contains filtered or unexported fields }
func (*Map[K, V]) LoadAndDelete ¶
func (*Map[K, V]) LoadOrStore ¶
func (*Map[K, V]) SortedRange ¶
func (*Map[K, V]) StoreAndReturn ¶
func (m *Map[K, V]) StoreAndReturn(key K, value V) V
type SimpleIndex ¶
type SimpleIndex[V Tableable] struct { // contains filtered or unexported fields }
func NewUniqueSimpleIndex ¶
func NewUniqueSimpleIndex[V Tableable](key func(*V) []any) *SimpleIndex[V]
func (*SimpleIndex[V]) Index ¶
func (p *SimpleIndex[V]) Index(v *V) error
func (*SimpleIndex[V]) Lookup ¶
func (p *SimpleIndex[V]) Lookup(v V) *V
Click to show internal directories.
Click to hide internal directories.