stdxgit.sr.ht/~pingoo/stdx/storage/filesystem Index | Files

package filesystem

import "git.sr.ht/~pingoo/stdx/storage/filesystem"

Index

Variables

var (
	ErrKeyIsNotValid    = errors.New("storage key is not valid")
	ErrPrefixIsNotValid = errors.New("storage prefix is not valid")
)

Types

type Config

type Config struct {
	BaseDirectory string
}

type FilesystemStorage

type FilesystemStorage struct {
	// contains filtered or unexported fields
}

func NewFilesystemStorage

func NewFilesystemStorage(config Config) *FilesystemStorage

func (*FilesystemStorage) BasePath

func (storage *FilesystemStorage) BasePath() string

func (*FilesystemStorage) CopyObject

func (storage *FilesystemStorage) CopyObject(ctx context.Context, from string, to string) (err error)

func (*FilesystemStorage) DeleteObject

func (storage *FilesystemStorage) DeleteObject(ctx context.Context, key string) (err error)

func (*FilesystemStorage) DeleteObjectsWithPrefix

func (storage *FilesystemStorage) DeleteObjectsWithPrefix(ctx context.Context, prefix string) (err error)

func (*FilesystemStorage) GetObject

func (storage *FilesystemStorage) GetObject(ctx context.Context, key string) (file io.ReadCloser, err error)

func (*FilesystemStorage) GetObjectSize

func (storage *FilesystemStorage) GetObjectSize(ctx context.Context, key string) (ret int64, err error)

func (*FilesystemStorage) PutObject

func (storage *FilesystemStorage) PutObject(ctx context.Context, key string, contentType string, size int64, object io.Reader) (err error)

Source Files

filesystem.go

Version
v0.0.0-20240218134121-094174641f6e (latest)
Published
Feb 18, 2024
Platform
linux/amd64
Imports
6 packages
Last checked
4 months ago

Tools for package owners.