s3

package
v0.0.76 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Package__eoj2dq = &core.Package{
		PackageName: "namespacelabs.dev/foundation/universe/aws/s3",
	}

	Provider__eoj2dq = core.Provider{
		Package:     Package__eoj2dq,
		Instantiate: makeDeps__eoj2dq,
	}
)
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 AwsConfig

type AwsConfig struct {
	Region, CredentialsPath string
}

type Bucket

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

func ProvideBucket

func ProvideBucket(ctx context.Context, bc *BucketConfig, deps ExtensionDeps) (*Bucket, error)

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 ExtensionDeps

type ExtensionDeps struct {
	ClientFactory  client.ClientFactory
	ReadinessCheck core.Check
}

Dependencies that are instantiated once for the lifetime of the extension.

type PutObjectOpt

type PutObjectOpt func(*s3.PutObjectInput)

func WithExpiration

func WithExpiration(expiration time.Time) PutObjectOpt

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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