Versions in this module Expand all Collapse all v0 v0.0.2 Apr 15, 2024 Changes in this version + var ErrClosed = errors.New("already closed") + var ErrSetExternalPathUnsupported = errors.New("setting the external path is unsupported for this bucket") + func AllPaths(ctx context.Context, readBucket ReadBucket, prefix string) ([]string, error) + func Copy(ctx context.Context, from ReadBucket, to WriteBucket, options ...CopyOption) (int, error) + func CopyPath(ctx context.Context, from ReadBucket, fromPath string, to WriteBucket, ...) error + func CopyReadObject(ctx context.Context, writeBucket WriteBucket, readObject ReadObject, ...) (retErr error) + func CopyReader(ctx context.Context, writeBucket WriteBucket, reader io.Reader, path string) (retErr error) + func Diff(ctx context.Context, runner command.Runner, writer io.Writer, one ReadBucket, ...) error + func DiffBytes(ctx context.Context, runner command.Runner, one ReadBucket, two ReadBucket, ...) ([]byte, error) + func Exists(ctx context.Context, readBucket ReadBucket, path string) (bool, error) + func IsEmpty(ctx context.Context, readBucket ReadBucket, prefix string) (bool, error) + func IsExistsMultipleLocations(err error) bool + func IsNotExist(err error) bool + func IsWriteLimitReached(err error) bool + func NewErrExistsMultipleLocations(path string, externalPaths ...string) error + func NewErrNotExist(path string) error + func PutPath(ctx context.Context, writeBucket WriteBucket, path string, data []byte) (retErr error) + func ReadPath(ctx context.Context, readBucket ReadBucket, path string) (_ []byte, retErr error) + func WalkReadObjects(ctx context.Context, readBucket ReadBucket, prefix string, ...) error + type CopyOption func(*copyOptions) + func CopyWithAtomic() CopyOption + func CopyWithExternalPaths() CopyOption + type DiffOption func(*diffOptions) + func DiffWithExternalPathPrefixes(oneExternalPathPrefix string, twoExternalPathPrefix string) DiffOption + func DiffWithExternalPaths() DiffOption + func DiffWithSuppressCommands() DiffOption + func DiffWithSuppressTimestamps() DiffOption + func DiffWithTransform(transform func(side string, filename string, content []byte) []byte) DiffOption + type Mapper interface + MapPath func(path string) (string, bool) + MapPrefix func(prefix string) (string, bool) + UnmapFullPath func(fullPath string) (string, bool, error) + func MapChain(mappers ...Mapper) Mapper + func MapOnPrefix(prefix string) Mapper + type Matcher interface + func MatchAnd(matchers ...Matcher) Matcher + func MatchNot(matcher Matcher) Matcher + func MatchOr(matchers ...Matcher) Matcher + func MatchPathBase(base string) Matcher + func MatchPathContained(containingDir string) Matcher + func MatchPathEqual(equalPath string) Matcher + func MatchPathEqualOrContained(equalOrContainingPath string) Matcher + func MatchPathExt(ext string) Matcher + type ObjectInfo interface + ExternalPath func() string + Path func() string + type PutOption func(*putOptions) + func PutWithAtomic() PutOption + func PutWithSuggestedChunkSize(suggestedChunkSize int) PutOption + type PutOptions interface + Atomic func() bool + SuggestedChunkSize func() int + SuggestedDisableChunking func() bool + func NewPutOptions(options []PutOption) PutOptions + type ReadBucket interface + Get func(ctx context.Context, path string) (ReadObjectCloser, error) + Stat func(ctx context.Context, path string) (ObjectInfo, error) + Walk func(ctx context.Context, prefix string, f func(ObjectInfo) error) error + func MapReadBucket(readBucket ReadBucket, mappers ...Mapper) ReadBucket + func MultiReadBucket(readBuckets ...ReadBucket) ReadBucket + func OverlayReadBucket(readBuckets ...ReadBucket) ReadBucket + type ReadBucketCloser interface + func NopReadBucketCloser(readBucket ReadBucket) ReadBucketCloser + type ReadObject interface + type ReadObjectCloser interface + type ReadWriteBucket interface + func MapReadWriteBucket(readWriteBucket ReadWriteBucket, mappers ...Mapper) ReadWriteBucket + type ReadWriteBucketCloser interface + func NopReadWriteBucketCloser(readWriteBucket ReadWriteBucket) ReadWriteBucketCloser + type WriteBucket interface + Delete func(ctx context.Context, path string) error + DeleteAll func(ctx context.Context, prefix string) error + Put func(ctx context.Context, path string, options ...PutOption) (WriteObjectCloser, error) + SetExternalPathSupported func() bool + func LimitWriteBucket(writeBucket WriteBucket, limit int) WriteBucket + func MapWriteBucket(writeBucket WriteBucket, mappers ...Mapper) WriteBucket + type WriteBucketCloser interface + func NopWriteBucketCloser(writeBucket WriteBucket) WriteBucketCloser + type WriteObject interface + SetExternalPath func(externalPath string) error + type WriteObjectCloser interface