aws

package
v0.0.0-...-6df37af Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AWS

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

func GetClient

func GetClient() (*AWS, error)

GetClient returns the global AWS client. It initializes the AWS client if it hasn't already been initialized.

func (*AWS) DownloadFile

func (a *AWS) DownloadFile(bucket, filename string) ([]byte, error)

DownloadFile downloads filename from bucket and

func (*AWS) GenerateFullReleaseFeedFromObjects

func (a *AWS) GenerateFullReleaseFeedFromObjects() (*download.JSONFeed, error)

GenerateFullReleaseFeedFromObjects will download all release artifacts from the tools s3 bucket, caluclate their md5, sha1, and sha256 digests, and create a download.JSONFeed object representing every artifact for every tools version.

func (*AWS) UploadBytes

func (a *AWS) UploadBytes(bucket, objPath, filename string, reader io.Reader) error

UploadBytes uploads data from a reader to the bucket, path, and filename specified.

func (*AWS) UploadFile

func (a *AWS) UploadFile(bucket, objPath, filename string) error

UploadFile will upload a file from the filesystem to the bucket and path specified. The uploaded file keeps its filename.

type ArtifactMetadata

type ArtifactMetadata struct {
	Name     string
	Version  string
	Platform string
	Arch     string
	Ext      string
}

ArtifactMetadata is a container to easily pass around some metadata extracted from s3 object filenames.

type HashWriterAt

type HashWriterAt struct {
	MD5    hash.Hash
	SHA1   hash.Hash
	SHA256 hash.Hash
	// contains filtered or unexported fields
}

HashWriterAt is used to calculate md5, sha1, and sha256 hashes in parallel. w is a MulitWriter that writes to all the Hash interfaces.

func (HashWriterAt) WriteAt

func (fw HashWriterAt) WriteAt(p []byte, offset int64) (n int, err error)

WriteAt fakes the io.WriterAt interface because s3manager.Downloarder.Download() expects an io.WriterAt. Since we set the concurrency of the downloader to 1, we can safely convert WriteAt calls to Write calls by ignoring the offset.

Jump to

Keyboard shortcuts

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