12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- package ezdb
- type Collection[T any] interface {
- Open() error
- Close() error
- Delete(key string) error
- Get(key string) (value T, err error)
- 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
|