s3

package
v0.0.397 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_universe_aws_s3_provider_proto protoreflect.FileDescriptor

Functions

func EnsureBucketExists

func EnsureBucketExists(ctx context.Context, client *s3.Client, bc *BucketConfig) error

EnsureBucketExists creates the requested bucket before it is used.

func EnsureBucketExistsByName

func EnsureBucketExistsByName(ctx context.Context, client *s3.Client, name, region string) error

Types

type Bucket

type Bucket struct {
	BucketName string
	S3Client   *s3.Client
}

func (Bucket) GetObject

func (b Bucket) GetObject(ctx context.Context, key string) (*s3.GetObjectOutput, error)

func (Bucket) PutObject

func (b Bucket) PutObject(ctx context.Context, key string, body io.Reader, opts ...PutObjectOpt) (*s3.PutObjectOutput, error)

type BucketConfig

type BucketConfig struct {
	Region     string `protobuf:"bytes,1,opt,name=region,proto3" json:"region,omitempty"`
	BucketName string `protobuf:"bytes,2,opt,name=bucket_name,json=bucketName,proto3" json:"bucket_name,omitempty"`
	// contains filtered or unexported fields
}

func (*BucketConfig) Descriptor deprecated

func (*BucketConfig) Descriptor() ([]byte, []int)

Deprecated: Use BucketConfig.ProtoReflect.Descriptor instead.

func (*BucketConfig) GetBucketName

func (x *BucketConfig) GetBucketName() string

func (*BucketConfig) GetRegion

func (x *BucketConfig) GetRegion() string

func (*BucketConfig) ProtoMessage

func (*BucketConfig) ProtoMessage()

func (*BucketConfig) ProtoReflect

func (x *BucketConfig) ProtoReflect() protoreflect.Message

func (*BucketConfig) Reset

func (x *BucketConfig) Reset()

func (*BucketConfig) String

func (x *BucketConfig) String() string

type PutObjectOpt

type PutObjectOpt func(*s3.PutObjectInput)

func WithExpiration

func WithExpiration(expiration time.Time) PutObjectOpt

Jump to

Keyboard shortcuts

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