Documentation ¶
Index ¶
- func FsPath(path string, flags FsFlags) (afero.Fs, error)
- func NewBasePathFs(source afero.Fs, path string, flags FsFlags) (afero.Fs, error)
- type FsFlags
- type Metadata
- type MultiBucketBackend
- func (db *MultiBucketBackend) BucketExists(name string) (exists bool, err error)
- func (db *MultiBucketBackend) CopyObject(srcBucket, srcKey, dstBucket, dstKey string, meta map[string]string) (result gofakes3.CopyObjectResult, err error)
- func (db *MultiBucketBackend) CreateBucket(name string) error
- func (db *MultiBucketBackend) DeleteBucket(name string) (rerr error)
- func (db *MultiBucketBackend) DeleteMulti(bucketName string, objects ...string) (result gofakes3.MultiDeleteResult, rerr error)
- func (db *MultiBucketBackend) DeleteObject(bucketName, objectName string) (result gofakes3.ObjectDeleteResult, rerr error)
- func (db *MultiBucketBackend) GetObject(bucketName, objectName string, rangeRequest *gofakes3.ObjectRangeRequest) (obj *gofakes3.Object, rerr error)
- func (db *MultiBucketBackend) HeadObject(bucketName, objectName string) (*gofakes3.Object, error)
- func (db *MultiBucketBackend) ListBucket(bucket string, prefix *gofakes3.Prefix, page gofakes3.ListBucketPage) (*gofakes3.ObjectList, error)
- func (db *MultiBucketBackend) ListBuckets() ([]gofakes3.BucketInfo, error)
- func (db *MultiBucketBackend) PutObject(bucketName, objectName string, meta map[string]string, input io.Reader, ...) (result gofakes3.PutObjectResult, err error)
- type MultiOption
- type SingleBucketBackend
- func (db *SingleBucketBackend) BucketExists(name string) (exists bool, err error)
- func (db *SingleBucketBackend) CopyObject(srcBucket, srcKey, dstBucket, dstKey string, meta map[string]string) (result gofakes3.CopyObjectResult, err error)
- func (db *SingleBucketBackend) CreateBucket(name string) error
- func (db *SingleBucketBackend) DeleteBucket(name string) error
- func (db *SingleBucketBackend) DeleteMulti(bucketName string, objects ...string) (result gofakes3.MultiDeleteResult, rerr error)
- func (db *SingleBucketBackend) DeleteObject(bucketName, objectName string) (result gofakes3.ObjectDeleteResult, rerr error)
- func (db *SingleBucketBackend) GetObject(bucketName, objectName string, rangeRequest *gofakes3.ObjectRangeRequest) (obj *gofakes3.Object, err error)
- func (db *SingleBucketBackend) HeadObject(bucketName, objectName string) (*gofakes3.Object, error)
- func (db *SingleBucketBackend) ListBucket(bucket string, prefix *gofakes3.Prefix, page gofakes3.ListBucketPage) (*gofakes3.ObjectList, error)
- func (db *SingleBucketBackend) ListBuckets() ([]gofakes3.BucketInfo, error)
- func (db *SingleBucketBackend) PutObject(bucketName, objectName string, meta map[string]string, input io.Reader, ...) (result gofakes3.PutObjectResult, err error)
- type SingleOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type MultiBucketBackend ¶
type MultiBucketBackend struct {
// contains filtered or unexported fields
}
MultiBucketBackend is a gofakes3.Backend that allows you to create multiple buckets within the same afero.Fs. Buckets are stored under the `/buckets` subdirectory. Metadata is stored in the `/metadata` subdirectory by default, but any afero.Fs can be used.
It is STRONGLY recommended that the metadata Fs is not contained within the `/buckets` subdirectory as that could make a significant mess, but this is infeasible to validate, so you're encouraged to be extremely careful!
func MultiBucket ¶
func MultiBucket(fs afero.Fs, opts ...MultiOption) (*MultiBucketBackend, error)
func (*MultiBucketBackend) BucketExists ¶
func (db *MultiBucketBackend) BucketExists(name string) (exists bool, err error)
func (*MultiBucketBackend) CopyObject ¶
func (db *MultiBucketBackend) CopyObject(srcBucket, srcKey, dstBucket, dstKey string, meta map[string]string) (result gofakes3.CopyObjectResult, err error)
func (*MultiBucketBackend) CreateBucket ¶
func (db *MultiBucketBackend) CreateBucket(name string) error
func (*MultiBucketBackend) DeleteBucket ¶
func (db *MultiBucketBackend) DeleteBucket(name string) (rerr error)
func (*MultiBucketBackend) DeleteMulti ¶
func (db *MultiBucketBackend) DeleteMulti(bucketName string, objects ...string) (result gofakes3.MultiDeleteResult, rerr error)
func (*MultiBucketBackend) DeleteObject ¶
func (db *MultiBucketBackend) DeleteObject(bucketName, objectName string) (result gofakes3.ObjectDeleteResult, rerr error)
func (*MultiBucketBackend) GetObject ¶
func (db *MultiBucketBackend) GetObject(bucketName, objectName string, rangeRequest *gofakes3.ObjectRangeRequest) (obj *gofakes3.Object, rerr error)
func (*MultiBucketBackend) HeadObject ¶
func (db *MultiBucketBackend) HeadObject(bucketName, objectName string) (*gofakes3.Object, error)
func (*MultiBucketBackend) ListBucket ¶
func (db *MultiBucketBackend) ListBucket(bucket string, prefix *gofakes3.Prefix, page gofakes3.ListBucketPage) (*gofakes3.ObjectList, error)
func (*MultiBucketBackend) ListBuckets ¶
func (db *MultiBucketBackend) ListBuckets() ([]gofakes3.BucketInfo, error)
type MultiOption ¶
type MultiOption func(b *MultiBucketBackend) error
func MultiFsFlags ¶
func MultiFsFlags(flags FsFlags) MultiOption
func MultiWithMetaFs ¶
func MultiWithMetaFs(fs afero.Fs) MultiOption
type SingleBucketBackend ¶
type SingleBucketBackend struct {
// contains filtered or unexported fields
}
SingleBucketBackend is a gofakes3.Backend that allows you to treat an existing filesystem as an S3 bucket directly. It does not support multiple buckets.
A second afero.Fs, metaFs, may be passed; if this is nil, afero.NewMemMapFs() is used and the metadata will not persist between restarts of gofakes3.
It is STRONGLY recommended that the metadata Fs is not contained within the `/buckets` subdirectory as that could make a significant mess, but this is infeasible to validate, so you're encouraged to be extremely careful!
func SingleBucket ¶
func SingleBucket(name string, fs afero.Fs, metaFs afero.Fs, opts ...SingleOption) (*SingleBucketBackend, error)
func (*SingleBucketBackend) BucketExists ¶
func (db *SingleBucketBackend) BucketExists(name string) (exists bool, err error)
func (*SingleBucketBackend) CopyObject ¶
func (db *SingleBucketBackend) CopyObject(srcBucket, srcKey, dstBucket, dstKey string, meta map[string]string) (result gofakes3.CopyObjectResult, err error)
func (*SingleBucketBackend) CreateBucket ¶
func (db *SingleBucketBackend) CreateBucket(name string) error
CreateBucket cannot be implemented by this backend. See MultiBucketBackend if you need a backend that supports it.
func (*SingleBucketBackend) DeleteBucket ¶
func (db *SingleBucketBackend) DeleteBucket(name string) error
DeleteBucket cannot be implemented by this backend. See MultiBucketBackend if you need a backend that supports it.
func (*SingleBucketBackend) DeleteMulti ¶
func (db *SingleBucketBackend) DeleteMulti(bucketName string, objects ...string) (result gofakes3.MultiDeleteResult, rerr error)
func (*SingleBucketBackend) DeleteObject ¶
func (db *SingleBucketBackend) DeleteObject(bucketName, objectName string) (result gofakes3.ObjectDeleteResult, rerr error)
func (*SingleBucketBackend) GetObject ¶
func (db *SingleBucketBackend) GetObject(bucketName, objectName string, rangeRequest *gofakes3.ObjectRangeRequest) (obj *gofakes3.Object, err error)
func (*SingleBucketBackend) HeadObject ¶
func (db *SingleBucketBackend) HeadObject(bucketName, objectName string) (*gofakes3.Object, error)
func (*SingleBucketBackend) ListBucket ¶
func (db *SingleBucketBackend) ListBucket(bucket string, prefix *gofakes3.Prefix, page gofakes3.ListBucketPage) (*gofakes3.ObjectList, error)
func (*SingleBucketBackend) ListBuckets ¶
func (db *SingleBucketBackend) ListBuckets() ([]gofakes3.BucketInfo, error)
type SingleOption ¶
type SingleOption func(b *SingleBucketBackend) error