store

package
v0.93.0-RC.0 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAzureInvalidURL = errors.New("invalid Azure storage URL")
View Source
var ErrNotSupported = errors.New("no storage adapter found")

Functions

This section is empty.

Types

type AzureBlobWalker added in v0.91.0

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

func NewAzureBlobWalker

func NewAzureBlobWalker(svc *service.Client) (*AzureBlobWalker, error)

func (*AzureBlobWalker) Marker added in v0.91.0

func (a *AzureBlobWalker) Marker() Mark

func (*AzureBlobWalker) Walk added in v0.91.0

func (a *AzureBlobWalker) Walk(ctx context.Context, storageURI *url.URL, op WalkOptions, walkFn func(e ObjectStoreEntry) error) error

type GCSWalker added in v0.91.0

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

func NewGCSWalker

func NewGCSWalker(client *storage.Client) *GCSWalker

func (*GCSWalker) Marker added in v0.91.0

func (w *GCSWalker) Marker() Mark

func (*GCSWalker) Walk added in v0.91.0

func (w *GCSWalker) Walk(ctx context.Context, storageURI *url.URL, op WalkOptions, walkFn func(e ObjectStoreEntry) error) error

type Mark

type Mark struct {
	ContinuationToken string
	LastKey           string
	HasMore           bool
}

type ObjectStoreEntry

type ObjectStoreEntry struct {
	// FullKey represents the fully qualified path in the object store namespace for the given entry
	FullKey string
	// RelativeKey represents a path relative to prefix (or directory). If none specified, will be identical to FullKey
	RelativeKey string
	// Address is a full URI for the entry, including the storage namespace (i.e. s3://bucket/path/to/key)
	Address string
	// ETag represents a hash of the entry's content. Generally as hex encoded MD5,
	// but depends on the underlying object store
	ETag string
	// Mtime is the last-modified datetime of the entry
	Mtime time.Time
	// Size in bytes
	Size int64
}

func (ObjectStoreEntry) String

func (e ObjectStoreEntry) String() string

type S3Walker added in v0.91.0

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

func NewS3Walker

func NewS3Walker(sess *session.Session) *S3Walker

func (*S3Walker) Marker added in v0.91.0

func (s *S3Walker) Marker() Mark

func (*S3Walker) Walk added in v0.91.0

func (s *S3Walker) Walk(ctx context.Context, storageURI *url.URL, op WalkOptions, walkFn func(e ObjectStoreEntry) error) error

type WalkOptions

type WalkOptions struct {
	// All walked items must be greater than After
	After string

	// ContinuationToken is passed to the client for efficient listing.
	// Value is Opaque to the caller.
	ContinuationToken string
}

type Walker

type Walker interface {
	Walk(ctx context.Context, storageURI *url.URL, op WalkOptions, walkFn func(e ObjectStoreEntry) error) error
	Marker() Mark
}

type WalkerFactory added in v0.91.0

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

func NewFactory

func NewFactory(params params.AdapterConfig) *WalkerFactory

func (*WalkerFactory) GetWalker added in v0.91.0

func (f *WalkerFactory) GetWalker(ctx context.Context, opts WalkerOptions) (*WalkerWrapper, error)

type WalkerOptions

type WalkerOptions struct {
	S3EndpointURL string
	StorageURI    string
}

type WalkerWrapper

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

func NewWrapper

func NewWrapper(walker Walker, uri *url.URL) *WalkerWrapper

func (*WalkerWrapper) Marker

func (ww *WalkerWrapper) Marker() Mark

func (*WalkerWrapper) Walk

func (ww *WalkerWrapper) Walk(ctx context.Context, opts WalkOptions, walkFn func(e ObjectStoreEntry) error) error

Jump to

Keyboard shortcuts

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