oss

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const ErrCodeNoSuchBucket = "NoSuchBucket"

ErrCodeNoSuchBucket is the error code "NoSuchBucket" returned by SDK

Variables

This section is empty.

Functions

func GenerateObservation

func GenerateObservation(r sdk.GetBucketInfoResult) v1alpha1.BucketObservation

GenerateObservation generates BucketObservation from bucket information

func IsNotFoundError

func IsNotFoundError(err error) bool

IsNotFoundError checks whether the error is an NotFound error

func IsUpdateToDate

func IsUpdateToDate(cr *v1alpha1.Bucket, bucket *sdk.GetBucketInfoResult) bool

IsUpdateToDate checks whether cr is up to date

func ValidateOSSAcl

func ValidateOSSAcl(aclStr string) (sdk.ACLType, error)

ValidateOSSAcl validates Bucket ACL and convert it to sdk.ACLType if possible

Types

type ClientInterface

type ClientInterface interface {
	Describe(name string) (*sdk.GetBucketInfoResult, error)
	Create(name string, bucket v1alpha1.BucketParameter) error
	Update(name string, aclStr string) error
	Delete(name string) error
}

ClientInterface will help fakeOSSClient in unit tests

type SDKClient

type SDKClient struct {
	Client *sdk.Client
}

SDKClient is the SDK client for Bucket

func NewClient

func NewClient(ctx context.Context, endpoint string, accessKeyID string, accessKeySecret string, stsToken string) (*SDKClient, error)

NewClient will create OSS client

func (*SDKClient) Create

func (c *SDKClient) Create(name string, bucket v1alpha1.BucketParameter) error

Create creates Bucket bucket

func (*SDKClient) Delete

func (c *SDKClient) Delete(name string) error

Delete deletes OSS Bucket

func (*SDKClient) Describe

func (c *SDKClient) Describe(name string) (*sdk.GetBucketInfoResult, error)

Describe describes OSS bucket

func (*SDKClient) Update

func (c *SDKClient) Update(name string, aclStr string) error

Update sets bucket acl

Jump to

Keyboard shortcuts

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