s3ts

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: May 4, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrUndefinedBucket = faults.Type("undefined S3 bucket")
	ErrServiceIO       = faults.Safe2[string, string]("service i/o failed (bucket: %s, key: %s)")
)

Variables

This section is empty.

Functions

func ErrNotFound

func ErrNotFound(err error, key string) error

NotFound is an error to handle unknown elements

func RecoverNoSuchKey

func RecoverNoSuchKey(err error) bool

func RecoverNotFound

func RecoverNotFound(err error) bool

Types

type Store

type Store[T stream.Stream] struct {
	// contains filtered or unexported fields
}

func New

func New[T stream.Stream](
	api *s3.Client,
	bucket string,
	prefixes curie.Prefixes,
) (*Store[T], error)

New client instance

func (*Store[T]) Copy

func (db *Store[T]) Copy(ctx context.Context, source T, target T) error

func (*Store[T]) Has

func (db *Store[T]) Has(ctx context.Context, key T, opts ...interface{ GetterOpt(T) }) (T, error)

Check existence of stream in the store, returning its metadata

func (*Store[T]) Match

func (db *Store[T]) Match(ctx context.Context, key T, opts ...interface{ MatcherOpt(T) }) ([]T, interface{ MatcherOpt(T) }, error)

Match

func (*Store[T]) Remove

func (db *Store[T]) Remove(ctx context.Context, entity T, opts ...interface{ WriterOpt(T) }) error

Remove stream from store

func (*Store[T]) Visit

func (db *Store[T]) Visit(ctx context.Context, key T, f func(T) error) error

Visit

func (*Store[T]) Wait

func (db *Store[T]) Wait(ctx context.Context, key T, timeout time.Duration) error

Jump to

Keyboard shortcuts

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