local

package
v0.0.1-beta Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2024 License: Apache-2.0, MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultNamespacePrefix = block.BlockstoreTypeLocal + "://"

Variables

View Source
var (
	ErrPathNotWritable         = errors.New("path provided is not writable")
	ErrInvalidUploadIDFormat   = errors.New("invalid upload id format")
	ErrBadPath                 = errors.New("bad path traversal blocked")
	ErrInvalidStorageNamespace = errors.New("invalid storageNamespace")
)

Functions

func VerifyAbsPath

func VerifyAbsPath(absPath, adapterPath string, allowedPrefixes []string) error

func WithAllowedExternalPrefixes

func WithAllowedExternalPrefixes(prefixes []string) func(a *Adapter)

func WithImportEnabled

func WithImportEnabled(b bool) func(a *Adapter)

func WithRemoveEmptyDir

func WithRemoveEmptyDir(b bool) func(a *Adapter)

Types

type Adapter

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

func NewAdapter

func NewAdapter(path string, opts ...func(a *Adapter)) (*Adapter, error)

func (*Adapter) AbortMultiPartUpload

func (l *Adapter) AbortMultiPartUpload(_ context.Context, obj block.ObjectPointer, uploadID string) error

func (*Adapter) BlockstoreType

func (l *Adapter) BlockstoreType() string

func (*Adapter) CompleteMultiPartUpload

func (l *Adapter) CompleteMultiPartUpload(_ context.Context, obj block.ObjectPointer, uploadID string, multipartList *block.MultipartUploadCompletion) (*block.CompleteMultiPartUploadResponse, error)

func (*Adapter) Copy

func (l *Adapter) Copy(_ context.Context, sourceObj, destinationObj block.ObjectPointer) error

func (*Adapter) Exists

func (l *Adapter) Exists(_ context.Context, obj block.ObjectPointer) (bool, error)

func (*Adapter) Get

func (l *Adapter) Get(_ context.Context, obj block.ObjectPointer, _ int64) (reader io.ReadCloser, err error)

func (*Adapter) GetPreSignedURL

func (l *Adapter) GetPreSignedURL(_ context.Context, _ block.ObjectPointer, _ block.PreSignMode) (string, time.Time, error)

func (*Adapter) GetProperties

func (l *Adapter) GetProperties(_ context.Context, obj block.ObjectPointer) (block.Properties, error)

func (*Adapter) GetRange

func (l *Adapter) GetRange(_ context.Context, obj block.ObjectPointer, start int64, end int64) (io.ReadCloser, error)

func (*Adapter) GetStorageNamespaceInfo

func (l *Adapter) GetStorageNamespaceInfo() block.StorageNamespaceInfo

func (*Adapter) GetWalker

func (l *Adapter) GetWalker(uri *url.URL) (block.Walker, error)

func (*Adapter) Path

func (l *Adapter) Path() string

func (*Adapter) Put

func (l *Adapter) Put(_ context.Context, obj block.ObjectPointer, _ int64, reader io.Reader, _ block.PutOpts) error

func (*Adapter) Remove

func (l *Adapter) Remove(_ context.Context, obj block.ObjectPointer) error

func (*Adapter) RemoveNameSpace

func (l *Adapter) RemoveNameSpace(_ context.Context, storageNamespace string) error

func (*Adapter) ResolveNamespace

func (l *Adapter) ResolveNamespace(storageNamespace, key string, identifierType block.IdentifierType) (block.QualifiedKey, error)

func (*Adapter) RuntimeStats

func (l *Adapter) RuntimeStats() map[string]string

func (*Adapter) UploadCopyPart

func (l *Adapter) UploadCopyPart(ctx context.Context, sourceObj, destinationObj block.ObjectPointer, uploadID string, partNumber int) (*block.UploadPartResponse, error)

func (*Adapter) UploadCopyPartRange

func (l *Adapter) UploadCopyPartRange(ctx context.Context, sourceObj, destinationObj block.ObjectPointer, uploadID string, partNumber int, startPosition, endPosition int64) (*block.UploadPartResponse, error)

func (*Adapter) UploadPart

func (l *Adapter) UploadPart(ctx context.Context, obj block.ObjectPointer, _ int64, reader io.Reader, uploadID string, partNumber int) (*block.UploadPartResponse, error)

type QualifiedKey

type QualifiedKey struct {
	block.CommonQualifiedKey
	// contains filtered or unexported fields
}

func (QualifiedKey) Format

func (qk QualifiedKey) Format() string

func (QualifiedKey) GetKey

func (qk QualifiedKey) GetKey() string

func (QualifiedKey) GetStorageNamespace

func (qk QualifiedKey) GetStorageNamespace() string

func (QualifiedKey) GetStorageType

func (qk QualifiedKey) GetStorageType() block.StorageType

type Walker

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

func NewLocalWalker

func NewLocalWalker(params params.Local) *Walker

func (*Walker) GetSkippedEntries

func (l *Walker) GetSkippedEntries() []block.ObjectStoreEntry

func (*Walker) Marker

func (l *Walker) Marker() block.Mark

func (*Walker) Walk

func (l *Walker) Walk(_ context.Context, storageURI *url.URL, options block.WalkOptions, walkFn func(e block.ObjectStoreEntry) error) error

Jump to

Keyboard shortcuts

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