Documentation
¶
Overview ¶
Package bucket bucket/bucket.go
Package bucket bucket/create.go
Package bucket bucket/delete.go
Package bucket bucket/errors.go
Package bucket bucket/exists.go
Package bucket bucket/list.go
Package bucket bucket/service.go
Package bucket bucket/utils.go
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInvalidBucketName invalid bucket name ErrInvalidBucketName = errors.New("invalid bucket name") // ErrBucketNotFound not found bucket ErrBucketNotFound = errors.New("bucket not found") // ErrBucketAlreadyExists bucket already exists ErrBucketAlreadyExists = errors.New("bucket already exists") // ErrBucketNotEmpty bucket not empty ErrBucketNotEmpty = errors.New("bucket not empty") )
Functions ¶
This section is empty.
Types ¶
type CreateOption ¶
type CreateOption func(*CreateOptions)
CreateOption create bucket options function
func WithForceCreate ¶
func WithForceCreate(force bool) CreateOption
WithForceCreate set force create
func WithObjectLocking ¶
func WithObjectLocking(enabled bool) CreateOption
WithObjectLocking set object locking
type CreateOptions ¶
type CreateOptions struct {
// Region
Region string
// ObjectLocking enable object locking
ObjectLocking bool
// ForceCreate force create (overwrite if exists)
ForceCreate bool
}
CreateOptions create bucket options
type DeleteOption ¶
type DeleteOption func(*DeleteOptions)
DeleteOption delete bucket options function
func WithForceDelete ¶
func WithForceDelete(force bool) DeleteOption
WithForceDelete set force delete
type DeleteOptions ¶
type DeleteOptions struct {
// ForceDelete force delete (delete even if not empty)
ForceDelete bool
}
DeleteOptions delete bucket options
type Service ¶
type Service interface {
// Create bucket
Create(ctx context.Context, bucketName string, opts ...CreateOption) error
// Delete bucket
Delete(ctx context.Context, bucketName string, opts ...DeleteOption) error
// Exists check if bucket exists
Exists(ctx context.Context, bucketName string) (bool, error)
// List buckets
List(ctx context.Context) ([]types.BucketInfo, error)
// GetLocation get bucket location/region
GetLocation(ctx context.Context, bucketName string) (string, error)
}
Service Bucket interface
func NewService ¶
func NewService(executor *core.Executor, locationCache *cache.LocationCache) Service
NewService Create a new Bucket Service
Click to show internal directories.
Click to hide internal directories.