objectstore

package
v0.2.19 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2026 License: MIT Imports: 10 Imported by: 0

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

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 Register

func Register(name string, factory Factory)

Register registers a new object store factory with the default factory registry.

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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