mfstorage

package module
v0.0.0-...-30c1c75 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 9, 2023 License: MIT Imports: 5 Imported by: 0

README

mfstorage

Multi-source File Storage

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrStoreNotFound

func ErrStoreNotFound(storeName string) error

func RegisterStorage

func RegisterStorage(name string, cfg ConfigFromMaps)

RegisterStorage registers a storage with the given name and configuration.

Parameters: - name: the name of the storage to register. - cfg: the configuration for the storage.

Types

type ConfigFromMaps

type ConfigFromMaps func(map[string]interface{}) (DatastoreConfig, error)

type DatastoreConfig

type DatastoreConfig interface {
	StoreInfo() StoreInfo

	// Create instantiate a new datastore from this config
	Create(path string) (datastore.Datastore, error)
}

func AnyDatastoreConfig

func AnyDatastoreConfig(params map[string]interface{}) (DatastoreConfig, error)

AnyDatastoreConfig returns a DatastoreConfig from a spec based on the "type" parameter

func LoadStorage

func LoadStorage(name string, cfg map[string]any) (DatastoreConfig, error)

LoadStorage loads a datastore configuration based on the given name and configuration map.

Parameters: - name: the name of the datastore to load. - cfg: the configuration map for the datastore.

Returns: - DatastoreConfig: the loaded datastore configuration. - error: an error if the datastore is not found.

func MountDatastoreConfig

func MountDatastoreConfig(params map[string]interface{}) (DatastoreConfig, error)

MountDatastoreConfig returns a mount DatastoreConfig from a spec

type StoreInfo

type StoreInfo map[string]interface{}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL