Documentation
¶
Overview ¶
Package storage implements the functions, types, and interfaces for the module.
Package storage implements the functions, types, and interfaces for the module.
Package storage implements the functions, types, and interfaces for the module.
Package storage implements the functions, types, and interfaces for the module.
Index ¶
- Constants
- func CacheToMap(caches []*storagev1.CacheConfig) map[string]*storagev1.CacheConfig
- func DatabaseToMap(databases []*storagev1.DatabaseConfig) map[string]*storagev1.DatabaseConfig
- func FileStoreToMap(fileStores []*storagev1.FileStoreConfig) map[string]*storagev1.FileStoreConfig
- func FromFileMeta(meta metaiface.FileMeta) (*storagev1.FileMeta, error)
- func FromSlice[T any, K comparable, V any](ts []T, f func(T) (K, V)) map[K]V
- func New(cfg *storagev1.CacheConfig) (storageiface.Cache, error)
- func NewProvider(cfg *datav1.Data) (storageiface.Provider, error)
- func OpenDatabase(database *storagev1.DatabaseConfig) (*sql.DB, error)
Constants ¶
View Source
const ( CacheModule = "storage.cache" ErrCacheConfigNil = errors.String("cache: config is nil") )
View Source
const (
ErrDatabaseConfigNil = errors.String("database: config is nil")
)
View Source
const ErrUnknownFileMetaType = errors.String("storage: unknown file meta type")
View Source
const ProviderModule = "storage.provider"
Variables ¶
This section is empty.
Functions ¶
func CacheToMap ¶ added in v0.2.8
func CacheToMap(caches []*storagev1.CacheConfig) map[string]*storagev1.CacheConfig
func DatabaseToMap ¶ added in v0.2.8
func DatabaseToMap(databases []*storagev1.DatabaseConfig) map[string]*storagev1.DatabaseConfig
func FileStoreToMap ¶ added in v0.2.8
func FileStoreToMap(fileStores []*storagev1.FileStoreConfig) map[string]*storagev1.FileStoreConfig
func FromFileMeta ¶ added in v0.2.5
func FromSlice ¶ added in v0.2.8
func FromSlice[T any, K comparable, V any](ts []T, f func(T) (K, V)) map[K]V
func New ¶ added in v0.2.6
func New(cfg *storagev1.CacheConfig) (storageiface.Cache, error)
New creates a new cache instance based on the provided configuration.
func NewProvider ¶ added in v0.2.6
func NewProvider(cfg *datav1.Data) (storageiface.Provider, error)
NewProvider creates a new storage provider based on the given configuration.
func OpenDatabase ¶
func OpenDatabase(database *storagev1.DatabaseConfig) (*sql.DB, error)
Types ¶
This section is empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
meta
Package meta implements the functions, types, and interfaces for the module.
|
Package meta implements the functions, types, and interfaces for the module. |
|
meta/v1
Package metav1 implements the functions, types, and interfaces for the module.
|
Package metav1 implements the functions, types, and interfaces for the module. |
|
meta/v2
Package metav2 implements the functions, types, and interfaces for the module.
|
Package metav2 implements the functions, types, and interfaces for the module. |
Click to show internal directories.
Click to hide internal directories.