Documentation
¶
Index ¶
- type EventObserver
- type FileStorage
- type JSONSerial
- type Lock
- type MemWithFile
- func NewMemWithFile[T any, S Serial, L syncx.RWLocker](d T, serial S, lock L, fileName string, storage FileStorage) (*MemWithFile[T, S, L], error)
- func NewMemWithFileEx[T any, S Serial, L syncx.RWLocker](d T, serial S, lock L, fileName string, storage FileStorage, ...) (*MemWithFile[T, S, L], error)
- func NewMemWithFileEx1[T any, S Serial, L syncx.RWLocker](d T, serial S, lock L, fileName string, storage FileStorage, ...) (*MemWithFile[T, S, L], error)
- type NoLock
- type Serial
- type Storage
- type Storage2
- type StorageCollect
- type StorageTiny
- type StorageTiny2
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventObserver ¶
type FileStorage ¶
type FileStorage interface {
WriteFile(name string, d []byte) error
ReadFile(name string) ([]byte, error)
}
func NewRawFSStorage ¶
func NewRawFSStorage(rootPath string) FileStorage
type JSONSerial ¶
type JSONSerial struct {
MarshalIndent bool
}
type MemWithFile ¶
type MemWithFile[T any, S Serial, L syncx.RWLocker] struct { // contains filtered or unexported fields }
func NewMemWithFile ¶
func NewMemWithFile[T any, S Serial, L syncx.RWLocker](d T, serial S, lock L, fileName string, storage FileStorage) ( *MemWithFile[T, S, L], error)
func NewMemWithFileEx ¶
func NewMemWithFileEx[T any, S Serial, L syncx.RWLocker](d T, serial S, lock L, fileName string, storage FileStorage, ob EventObserver[T]) (*MemWithFile[T, S, L], error)
func NewMemWithFileEx1 ¶
func NewMemWithFileEx1[T any, S Serial, L syncx.RWLocker](d T, serial S, lock L, fileName string, storage FileStorage, ob EventObserver[T], autoSaveInterval time.Duration) (*MemWithFile[T, S, L], error)
func (*MemWithFile[T, S, L]) Change ¶
func (mwf *MemWithFile[T, S, L]) Change(proc func(memD T) (newMemD T, err error)) error
func (*MemWithFile[T, S, L]) Read ¶
func (mwf *MemWithFile[T, S, L]) Read(proc func(memD T))
type StorageCollect ¶
type StorageTiny ¶
type StorageTiny interface {
Storage
StorageCollect
}
type StorageTiny2 ¶
type StorageTiny2 interface {
Storage2
StorageCollect
}
func NewKV ¶
func NewKV(file string) (StorageTiny2, error)
func NewKVEx ¶
func NewKVEx(file string, storage FileStorage) (StorageTiny2, error)
Click to show internal directories.
Click to hide internal directories.