s3client

package
v0.0.0-...-ac56535 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Charms

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

Charms is the client desienged to interact with the s3 compatible object store hosted by the apiserver

func NewCharmsS3Client

func NewCharmsS3Client(session Session) *Charms

NewCharmsS3Client creates a client to interact with charm blobs stored on the apiserver's s3 comptabile object store.

func (*Charms) GetCharm

func (c *Charms) GetCharm(ctx context.Context, modelUUID, charmRef string) (io.ReadCloser, error)

GetCharm retrieves a charm from the S3-compatible object store hosted by the apiserver. Returns an archived charm as a stream of bytes

type Logger

type Logger interface {
	Errorf(message string, args ...interface{})
	Warningf(message string, args ...interface{})
	Infof(message string, args ...interface{})
	Debugf(message string, args ...interface{})
	Tracef(message string, args ...interface{})
}

Logger represents the logging methods called.

type S3Client

type S3Client interface {
	GetObject(ctx context.Context, params *s3.GetObjectInput, optFns ...func(*s3.Options)) (*s3.GetObjectOutput, error)
}

S3Client represents the S3 client methods required by objectClient

type Session

type Session interface {
	GetObject(ctx context.Context, bucketName, objectName string) (io.ReadCloser, error)
}

Session represents the interface objectClient exports to interact with S3

func NewS3Client

func NewS3Client(apiConn api.Connection, logger Logger) (Session, error)

NewS3Client creates a generic S3 client which Juju should use to drive it's object store requirements

Jump to

Keyboard shortcuts

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