Documentation
¶
Overview ¶
Package objectstore provides a factory function to create ObjectStore instances.
Index ¶
Constants ¶
View Source
const (
DefaultDriver = "local" // Define a default driver
)
View Source
const Module = "storage.objectstore"
Variables ¶
View Source
var DefaultProvider component.Provider = func(ctx context.Context, h component.Handle) (any, error) { cfg, err := engine.AsConfig[ossv1.ObjectStoreConfig](h) if err != nil { return nil, err } return New(cfg) }
DefaultProvider is the default provider for object store components.
Functions ¶
func New ¶
func New(cfg *ossv1.ObjectStoreConfig, opts ...options.Option) (storageiface.ObjectStore, error)
New creates a new ObjectStore instance based on the provided configuration. It uses the internal factory registry to find the appropriate provider. To use a specific provider (e.g., "minio"), ensure its package is imported for its side effects (e.g., `import _ "path/to/minio/provider"`), which will register the provider's factory.
func Resolve ¶ added in v0.2.19
func Resolve(ctx context.Context, source any, opts *component.LoadOptions) (*component.ModuleConfig, error)
Resolve resolves the objectstore configuration.
Types ¶
type Factory ¶
type Factory interface {
New(cfg *ossv1.ObjectStoreConfig, opts ...options.Option) (storageiface.ObjectStore, error) // Changed cfg type
}
Factory is the interface for creating new ObjectStore components.
Click to show internal directories.
Click to hide internal directories.