package s3api

import "github.com/oslokommune/okctl/pkg/s3api"

Package s3api provides some convenience functions for interacting with the AWS S3 API

Index

Variables

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

ErrBucketDoesNotExist represents that the specified bucket does not exist

Types

type S3API

type S3API struct {
	// contains filtered or unexported fields
}

S3API contains the state required for interacting with the AWS S3 API

func New

func New(provider v1alpha1.CloudProvider) *S3API

New returns an initialised AWS S3 API client

func (*S3API) DeleteObject

func (a *S3API) DeleteObject(bucket, key string) error

DeleteObject removes the object at bucket/key

func (*S3API) EmptyBucket

func (a *S3API) EmptyBucket(bucketName string) error

EmptyBucket deletes all objects, versions and delete markers from a bucket, making the bucket itself deletable

func (*S3API) GetObject

func (a *S3API) GetObject(bucket, key string) (io.ReadCloser, error)

GetObject retrieves the object at bucket/key

func (*S3API) PutObject

func (a *S3API) PutObject(bucket, key string, body io.ReadSeeker) error

PutObject stores the provided in the given bucket/key

Source Files

errors.go s3api.go

Version
v0.0.106 (latest)
Published
Oct 21, 2022
Platform
linux/amd64
Imports
7 packages
Last checked
18 hours ago

Tools for package owners.