Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetupFolders ¶
func SetupFolders()
SetupFolders ensures that required application directories exist.
Types ¶
type Identifiable ¶
type Identifiable interface {
GetID() string
}
Identifiable is an interface for types that have a unique identifier.
type Storage ¶
type Storage[T Identifiable] interface { Get(ctx context.Context, id string) (T, error) Set(ctx context.Context, item T) error Keys(ctx context.Context) iter.Seq[string] Delete(ctx context.Context, item T) (bool, error) }
Storage is a generic interface for storing and retrieving identifiable items.
type StorageProvider ¶
type StorageProvider[T Identifiable] interface { AppStorage() (Storage[T], error) UserStorage() (Storage[T], error) StateStorage() (Storage[T], error) }
StorageProvider provides access to different storage locations.
func DBStorage ¶
func DBStorage[T Identifiable](db *persistence.DB) StorageProvider[T]
DBStorage creates a database-based storage provider for the given type.
func FileStorage ¶
func FileStorage[T Identifiable]() StorageProvider[T]
FileStorage creates a file-based storage provider for the given type.
Click to show internal directories.
Click to hide internal directories.