buckets

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateBucketName

func ValidateBucketName(name string) error

ValidateBucketName validates a given bucket name

Types

type Bucket

type Bucket struct {
	Name                  string `json:"name"`
	Region                string `json:"region"`
	URLPathStyle          string `json:"urlPathStyle"`
	URLVirtualHostedStyle string `json:"urlVirtualHostedStyle"`
}

Bucket holds all the bucket information

type BucketListResponse

type BucketListResponse struct {
	Project string   `json:"project"`
	Buckets []Bucket `json:"buckets"`
}

BucketListResponse is a struct representation of stackit's object storage api response for a bucket list

type BucketResponse

type BucketResponse struct {
	Project string `json:"project"`
	Bucket  Bucket `json:"bucket"`
}

BucketResponse is a struct representation of stackit's object storage api response for a bucket

type ObjectStorageBucketsService

type ObjectStorageBucketsService common.Service

ObjectStorageBucketsService is the service that handles CRUD functionality for SKE buckets

func New

New returns a new handler for the service

func (*ObjectStorageBucketsService) Create

func (svc *ObjectStorageBucketsService) Create(ctx context.Context, projectID, bucketName string) (w *wait.Handler, err error)

Create creates a new bucket and returns a wait handler which upon call to `Wait()` will wait until the bucket is successfully created Wait() returns the created Bucket and error if it occurred See also https://api.stackit.schwarz/object-storage-service/openapi.v1.html#operation/create_bucket_v1_project__projectId__bucket__bucketName__post

func (*ObjectStorageBucketsService) Delete

func (svc *ObjectStorageBucketsService) Delete(ctx context.Context, projectID, bucketName string) (w *wait.Handler, err error)

Delete deletes a bucket which upon call to `Wait()` will wait until the bucket is successfully deleted Wait() returns an error if it occurred See also https://api.stackit.schwarz/ske-service/openapi.v1.html#operation/SkeService_DeleteBucket

func (*ObjectStorageBucketsService) Get

func (svc *ObjectStorageBucketsService) Get(ctx context.Context, projectID, bucketName string) (res BucketResponse, err error)

Get returns the a bucket by project ID and bucket name See also https://api.stackit.schwarz/object-storage-service/openapi.v1.html#operation/get_bucket_v1_project__projectId__bucket__bucketName__get

func (*ObjectStorageBucketsService) List

func (svc *ObjectStorageBucketsService) List(ctx context.Context, projectID string) (res BucketListResponse, err error)

List returns the a list of buckets assigned to a project ID See also https://api.stackit.schwarz/object-storage-service/openapi.v1.html#operation/get_buckets_v1_project__projectId__buckets_get

Jump to

Keyboard shortcuts

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