Documentation
¶
Index ¶
- func DeleteBucket(ctx context.Context, cfg Config, bucket string) error
- func ListBuckets(ctx context.Context, cfg Config) ([]string, error)
- func TestConnection(ctx context.Context, cfg Config) error
- type Client
- func (c *Client) BucketExists(ctx context.Context) (bool, error)
- func (c *Client) Delete(ctx context.Context, path string) error
- func (c *Client) EnsureBucket(ctx context.Context) error
- func (c *Client) Get(ctx context.Context, path string) (storage.Object, error)
- func (c *Client) List(ctx context.Context) ([]storage.ObjectEntry, error)
- func (c *Client) Move(ctx context.Context, oldPath, newPath string) error
- func (c *Client) Put(ctx context.Context, path string, content []byte, mimeType string) error
- func (c *Client) Stat(ctx context.Context, path string) (storage.ObjectEntry, error)
- func (c *Client) TotalSize(ctx context.Context) (int64, error)
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteBucket ¶
DeleteBucket empties bucket (removing every object) and then removes the bucket itself — S3 requires a bucket to be empty before it can be removed.
func ListBuckets ¶
ListBuckets returns the names of every bucket visible to the credentials in cfg. Unlike Client, which is scoped to one bucket, this is a package-level admin helper for callers that need to enumerate buckets across an entire endpoint (e.g. test cleanup).
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func New ¶
New constructs a client scoped to one bucket. PathStyle:true maps to minio.Options{BucketLookup: minio.BucketLookupPath} — required for Garage.
func (*Client) BucketExists ¶
BucketExists reports whether the bucket already exists, without creating it.
func (*Client) EnsureBucket ¶
EnsureBucket idempotently creates the bucket if it doesn't exist (BucketExists -> MakeBucket). Mirrors internal/service/v1/vault/vault.go's tolerance of CouchDbDatabaseAlreadyExists for adminClient.CreateDatabase — if MakeBucket fails because the bucket now exists (race), that's not an error either.
func (*Client) Move ¶
Move copies the object to newPath then removes oldPath — minio-go has no native rename/move.