1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- package ezdb
- type Collection[T any] interface {
- Open() error
- Close() error
- Count() int
- Delete(key string) error
- DeleteAll() error
- Get(key string) (value T, err error)
- GetAll() (map[string]T, error)
- GetAllKeys() []string
- Has(key string) (has bool, err error)
- Put(key string, value T) error
- Iter() Iterator[T]
- }
- type DocumentMarshaler[T1 any, T2 any] interface {
- Factory() T1
- Marshal(src T1) (T2, error)
- Unmarshal(src T2, dest T1) error
- }
- type FilterFunc[T any] func(key string, value T) bool
- type Iterator[T any] interface {
- First() bool
- Last() bool
- Next() bool
- Prev() bool
- Release()
- Count() int
- Get() (key string, value T, err error)
- Key() string
- Value() (T, error)
- GetAll() (map[string]T, error)
- GetAllKeys() []string
- Filter(f FilterFunc[T]) Iterator[T]
- Sort(f SortFunc[T]) Iterator[T]
- SortKeys(f SortFunc[string]) Iterator[T]
- }
- type SortFunc[T any] func(a T, b T) bool
|