Version: v0.0.0-...-6684559 Latest Latest

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

Go to latest
Published: May 3, 2023 License: Apache-2.0 Imports: 12 Imported by: 0




This section is empty.


View Source
var (
	ErrBucketDoesNotExist = errors.New("s3 bucket does not exist")


This section is empty.


type Bucket

type Bucket interface {
	Describe(bucketName, partition string) (BucketDetails, error)
	Create(bucketName string, details BucketDetails) (string, error)
	Modify(bucketName string, details BucketDetails) error
	Delete(bucketName string, deleteObjects bool) error

type BucketDetails

type BucketDetails struct {
	BucketName      string
	ARN             string
	Region          string
	Policy          string
	Encryption      string
	AwsPartition    string
	Tags            map[string]string
	FIPSEndpoint    string
	ObjectOwnership string

type S3Bucket

type S3Bucket struct {
	// contains filtered or unexported fields

func NewS3Bucket

func NewS3Bucket(
	s3svc S3Client,
	logger lager.Logger,
) *S3Bucket

func (*S3Bucket) Create

func (s *S3Bucket) Create(bucketName string, bucketDetails BucketDetails) (string, error)

Create attempts to create an S3 bucket. If successful, it returns the bucket's location and a nil error. If not, it returns an empty string and an error.

func (*S3Bucket) Delete

func (s *S3Bucket) Delete(bucketName string, deleteObjects bool) error

func (*S3Bucket) Describe

func (s *S3Bucket) Describe(bucketName, partition string) (BucketDetails, error)

func (*S3Bucket) Modify

func (s *S3Bucket) Modify(bucketName string, bucketDetails BucketDetails) error

type S3Client

type S3Client interface {
	GetBucketLocation(input *s3.GetBucketLocationInput) (*s3.GetBucketLocationOutput, error)
	CreateBucket(input *s3.CreateBucketInput) (*s3.CreateBucketOutput, error)
	PutBucketTagging(input *s3.PutBucketTaggingInput) (*s3.PutBucketTaggingOutput, error)
	PutBucketEncryption(input *s3.PutBucketEncryptionInput) (*s3.PutBucketEncryptionOutput, error)
	PutBucketPolicy(input *s3.PutBucketPolicyInput) (*s3.PutBucketPolicyOutput, error)
	DeletePublicAccessBlock(input *s3.DeletePublicAccessBlockInput) (*s3.DeletePublicAccessBlockOutput, error)
	DeleteBucket(input *s3.DeleteBucketInput) (*s3.DeleteBucketOutput, error)
	GetPublicAccessBlock(input *s3.GetPublicAccessBlockInput) (*s3.GetPublicAccessBlockOutput, error)

Jump to

Keyboard shortcuts

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