Documentation
¶
Index ¶
- func DefaultHTTPClient(logger logger.Logger) *jujuhttp.Client
- type AnonymousCredentials
- type Blobs
- type Credentials
- type CredentialsKind
- type HTTPClient
- type S3Client
- func (c *S3Client) CreateBucket(ctx context.Context, bucketName string) error
- func (c *S3Client) DeleteObject(ctx context.Context, bucketName, objectName string) error
- func (c *S3Client) GetObject(ctx context.Context, bucketName, objectName string) (io.ReadCloser, int64, string, error)
- func (c *S3Client) ListObjects(ctx context.Context, bucketName string) ([]string, error)
- func (c *S3Client) ObjectExists(ctx context.Context, bucketName, objectName string) error
- func (c *S3Client) PutObject(ctx context.Context, bucketName, objectName string, body io.Reader, ...) error
- type Session
- type StaticCredentials
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AnonymousCredentials ¶
type AnonymousCredentials struct {
Credentials
}
AnonymousCredentials represents anonymous credentials.
func (AnonymousCredentials) Kind ¶
func (AnonymousCredentials) Kind() CredentialsKind
Kind returns the kind of credentials.
type Blobs ¶
type Blobs struct {
// contains filtered or unexported fields
}
Blobs is the client desienged to interact with the s3 compatible object store hosted by the apiserver
func NewBlobsS3Client ¶
NewBlobsS3Client creates a client to interact with charm blobs stored on the apiserver's s3 compatible object store.
type Credentials ¶
type Credentials interface {
Kind() CredentialsKind
}
Credentials represents the credentials used to access the object store.
type CredentialsKind ¶
type CredentialsKind string
CredentialsKind represents the kind of credentials used to access the object store.
const ( // AnonymousCredentialsKind represents anonymous credentials. AnonymousCredentialsKind CredentialsKind = "anonymous" // StaticCredentialsKind represents static credentials. StaticCredentialsKind CredentialsKind = "static" )
type HTTPClient ¶
HTTPClient represents the http client used to access the object store.
type S3Client ¶
type S3Client struct {
// contains filtered or unexported fields
}
objectsClient is a Juju shim around the AWS S3 client, which Juju uses to drive it's object store requirents
func NewS3Client ¶
func NewS3Client(endpoint string, httpClient HTTPClient, credentials Credentials, logger logger.Logger) (*S3Client, error)
NewS3Client returns a new s3Caller client for accessing the object store.
func (*S3Client) CreateBucket ¶
CreateBucket creates a bucket in the object store based on the bucket name.
func (*S3Client) DeleteObject ¶
DeleteObject deletes an object from the object store based on the bucket name and object name.
func (*S3Client) GetObject ¶
func (c *S3Client) GetObject(ctx context.Context, bucketName, objectName string) (io.ReadCloser, int64, string, error)
GetObject gets an object from the object store based on the bucket name and object name.
func (*S3Client) ListObjects ¶
ListObjects returns a list of objects in the specified bucket.
func (*S3Client) ObjectExists ¶
ObjectExists checks if an object exists in the object store based on the bucket name and object name. Returns nil if the object exists, or an error if it does not.
type Session ¶
type Session interface { // GetObject returns a reader for the specified object. GetObject(ctx context.Context, bucketName, objectName string) (io.ReadCloser, int64, string, error) }
Session is the interface that wraps the GetObject method.
type StaticCredentials ¶
S3Client is a Juju shim around the AWS S3 client, which Juju uses to drive its object store requirements. StaticCredentials represents static credentials.
func (StaticCredentials) Kind ¶
func (StaticCredentials) Kind() CredentialsKind
Kind returns the kind of credentials.