store

package
v0.90.1 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

func NewAzureBlobWalker

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

func NewFactory

func NewFactory(params params.AdapterConfig) *walkerFactory

func NewGCSWalker

func NewGCSWalker(client *storage.Client) *gcsWalker

func NewS3Walker

func NewS3Walker(sess *session.Session) *s3Walker

Types

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 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 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