aws

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2018 License: Apache-2.0 Imports: 13 Imported by: 1

Documentation

Index

Constants

View Source
const DefaultExpireWindow = 20

DefaultExpireWindow is the default amount of seconds that the credentials are assumed to be expired, before they are actually expired. This will prevent the server from rejecting the credentials because they were just expired.

View Source
const ProviderName = `NerdalizeProvider`

ProviderName is the name of the credentials provider.

View Source
const (
	//StatusCodeForbidden is returned by AWS when a user does not have access to perform a given operation
	StatusCodeForbidden = "Forbidden"
)

Variables

This section is empty.

Functions

func NewNerdalizeCredentials

func NewNerdalizeCredentials(c v1batch.ClientTokenInterface, nlzProjectID string) *credentials.Credentials

NewNerdalizeCredentials creates a new credentials object with the NerdalizeProvider as provider.

Types

type DataClient

type DataClient struct {
	Service *s3.S3
}

DataClient is a client to AWS' S3 service. The client implements the v1data.DataOps interface.

func NewDataClient

func NewDataClient(c *credentials.Credentials, region string) (*DataClient, error)

NewDataClient creates a new DataClient.

func (*DataClient) Download added in v0.4.12

func (c *DataClient) Download(ctx context.Context, bucket, key string) (body io.ReadCloser, err error)

Download downloads an object to S3.

func (*DataClient) Exists added in v0.4.12

func (c *DataClient) Exists(ctx context.Context, bucket, key string) (exists bool, err error)

Exists checks whether an object exists on S3.

func (*DataClient) Upload added in v0.4.12

func (c *DataClient) Upload(ctx context.Context, bucket, key string, body io.ReadSeeker) error

Upload uploads an object to S3.

type Provider

type Provider struct {
	credentials.Expiry
	ExpiryWindow time.Duration
	Client       v1batch.ClientTokenInterface
	NlzProjectID string
}

Provider satisfies the credentials.Provider interface, and is a client to retrieve credentials from the nerdalize api.

func (*Provider) IsExpired

func (p *Provider) IsExpired() bool

IsExpired checks if the AWS sessions is expired.

func (*Provider) Retrieve

func (p *Provider) Retrieve() (credentials.Value, error)

Retrieve will attempt to request the credentials from the nerdalize api. And error will be returned if the retrieval fails.

type QueueClient added in v0.4.12

type QueueClient struct {
	Service *sqs.SQS
}

QueueClient is a client to AWS' SQS queueing service. The client implements the v1batch.QueueOps interface.

func NewQueueClient added in v0.4.12

func NewQueueClient(c *credentials.Credentials, region string) (*QueueClient, error)

NewQueueClient creates a new QueueClient

func (*QueueClient) DeleteMessage added in v0.4.12

func (c *QueueClient) DeleteMessage(queueURL string, message interface{}) error

DeleteMessage deletes a message from the queue.

func (*QueueClient) ReceiveMessages added in v0.4.12

func (c *QueueClient) ReceiveMessages(queueURL string, maxNoOfMessages, waitTimeSeconds int64) (messages []interface{}, err error)

ReceiveMessages receives messages from the queue.

func (*QueueClient) UnmarshalMessage added in v0.4.12

func (c *QueueClient) UnmarshalMessage(message interface{}, v interface{}) error

UnmarshalMessage decodes a message.

Jump to

Keyboard shortcuts

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