cloud

package
v0.0.25 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: MIT Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotDir = fmt.Errorf("not a directory")

Functions

func WithLogger

func WithLogger(l *slog.Logger) fsOption

Types

type FS

type FS struct {
	*blob.Bucket

	// Experimental config
	ObjectRootsUseWalkDirs bool
	ObjectRootWalkDirsGos  int
	// contains filtered or unexported fields
}

FS is a generic backend for cloud storage backends using a blob.Bucket

func NewFS

func NewFS(b *blob.Bucket, opts ...fsOption) *FS

func (*FS) Copy

func (fsys *FS) Copy(ctx context.Context, dst, src string) error

func (*FS) ObjectRoots

func (fsys *FS) ObjectRoots(ctx context.Context, sel ocfl.PathSelector, fn func(obj *ocfl.ObjectRoot) error) error

ObjectRoots implements ObjectRootIterator

func (*FS) OpenFile

func (fsys *FS) OpenFile(ctx context.Context, name string) (fs.File, error)

func (*FS) ReadDir

func (fsys *FS) ReadDir(ctx context.Context, name string) ([]fs.DirEntry, error)

func (*FS) ReaderOptions

func (fsys *FS) ReaderOptions(opts *blob.ReaderOptions) *FS

func (*FS) Remove

func (fsys *FS) Remove(ctx context.Context, name string) error

func (*FS) RemoveAll

func (fsys *FS) RemoveAll(ctx context.Context, name string) error

func (*FS) Write

func (fsys *FS) Write(ctx context.Context, name string, r io.Reader) (int64, error)

func (*FS) WriterOptions

func (fsys *FS) WriterOptions(opts *blob.WriterOptions) *FS

Jump to

Keyboard shortcuts

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