azblob

package
v1.34.0 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2023 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithEndpoint

func WithEndpoint(endpoint string) containers.Option[SnapshotStore]

WithEndpoint configures the endpoint

func WithPollOptions

func WithPollOptions(opts ...containers.Option[storagefs.Poller]) containers.Option[SnapshotStore]

WithPollOptions configures the poller options used when periodically updating snapshot state

Types

type FS

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

FS is only for accessing files in a single bucket. The directory entries are cached. It is specifically intended for use by a source that calls fs.WalkDir and does not fully implement all fs operations

func NewFS

func NewFS(logger *zap.Logger, schema string, containerName string) (*FS, error)

New creates a FS for the container

func (*FS) Open

func (f *FS) Open(name string) (fs.File, error)

Open implements fs.FS. it fetches the object contents from azure blob.

func (*FS) ReadDir

func (f *FS) ReadDir(name string) ([]fs.DirEntry, error)

ReadDir implements fs.ReadDirFS. This can only be called on the current directory

func (*FS) Stat

func (f *FS) Stat(name string) (fs.FileInfo, error)

Stat implements fs.StatFS. For the filesystem, this gets the objects in the container and stores them for later use.

type SnapshotStore

type SnapshotStore struct {
	*storagefs.Poller
	// contains filtered or unexported fields
}

SnapshotStore represents an implementation of storage.SnapshotStore This implementation is backed by an S3 bucket

func NewSnapshotStore

func NewSnapshotStore(ctx context.Context, logger *zap.Logger, container string, opts ...containers.Option[SnapshotStore]) (*SnapshotStore, error)

NewSnapshotStore constructs a Store

func (*SnapshotStore) String

func (s *SnapshotStore) String() string

String returns an identifier string for the store type.

func (*SnapshotStore) View

func (s *SnapshotStore) View(fn func(storage.ReadOnlyStore) error) error

View accepts a function which takes a *StoreSnapshot. The SnapshotStore will supply a snapshot which is valid for the lifetime of the provided function call.

Jump to

Keyboard shortcuts

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