storage

package
v0.0.0-...-4c964c4 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDriver

func NewDriver(ctx context.Context, name string, parameters map[string]interface{}) (driver.StorageDriver, error)

Types

type CommonContentStoreOption

type CommonContentStoreOption interface {
	Apply(store *commonContentStore)
}

func WithPrefix

func WithPrefix(dir string) CommonContentStoreOption

type Config

type Config struct {
	Local DriverConfig
	S3    DriverConfig
}

type ContentStorage

type ContentStorage interface {
	Get(ctx context.Context, path string) ([]byte, error)
	Open(ctx context.Context, path string) (io.ReadCloser, error)
	Put(ctx context.Context, path string, contents []byte) error
	Save(ctx context.Context, path string, r io.Reader, size int64) error
	GetWriter(ctx context.Context, path string, append bool) (storagedriver.FileWriter, error)
	Stat(ctx context.Context, path string) (storagedriver.FileInfo, error)
	Delete(ctx context.Context, path string) error
	List(ctx context.Context, path string) ([]string, error)

	PrefixDir() string
}

type DriverConfig

type DriverConfig struct {
	Driver     DriverType
	Parameters map[string]interface{}
}

type DriverGetter

type DriverGetter interface {
	Get(ctx context.Context, provider DriverType, config Config) (driver.StorageDriver, error)
}

type DriverType

type DriverType string
const (
	DriverFilesystem DriverType = "filesystem"
)

Directories

Path Synopsis
base
Package base provides a base implementation of the storage driver that can be used to implement common checks.
Package base provides a base implementation of the storage driver that can be used to implement common checks.

Jump to

Keyboard shortcuts

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