Documentation ¶
Index ¶
- func WithEndpoint(endpoint string) containers.Option[SnapshotStore]
- func WithPollOptions(opts ...containers.Option[storagefs.Poller]) containers.Option[SnapshotStore]
- func WithPrefix(prefix string) containers.Option[SnapshotStore]
- func WithRegion(region string) containers.Option[SnapshotStore]
- type FS
- type S3ClientAPI
- type SnapshotStore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithEndpoint ¶
func WithEndpoint(endpoint string) containers.Option[SnapshotStore]
WithEndpoint configures the region for s3
func WithPollOptions ¶
func WithPollOptions(opts ...containers.Option[storagefs.Poller]) containers.Option[SnapshotStore]
WithPollOptions configures the poller options used when periodically updating snapshot state
func WithPrefix ¶
func WithPrefix(prefix string) containers.Option[SnapshotStore]
WithPrefix configures the prefix for s3
func WithRegion ¶
func WithRegion(region string) containers.Option[SnapshotStore]
WithRegion configures the region for s3
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 (*FS) Open ¶
Open implements fs.FS. For the S3 filesystem, it fetches the object contents from s3.
func (*FS) ReadDir ¶
ReadDir implements fs.ReadDirFS. This can only be called on the current directory as the s3 filesystem does not support any kind of recursive directory structure
type S3ClientAPI ¶
type S3ClientAPI interface { ListObjectsV2(context.Context, *s3.ListObjectsV2Input, ...func(*s3.Options)) (*s3.ListObjectsV2Output, error) GetObject(context.Context, *s3.GetObjectInput, ...func(*s3.Options)) (*s3.GetObjectOutput, error) }
type SnapshotStore ¶
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, bucket 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.