s3

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2018 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Storage

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

Storage implements (github.com/gomods/athens/pkg/storage).Saver and also provides a function to fetch the location of a module Storage uses amazon aws go SDK which expects these env variables - AWS_REGION - region for this storage, e.g 'us-west-2' - AWS_ACCESS_KEY_ID - - AWS_SECRET_ACCESS_KEY - - AWS_SESSION_TOKEN - [optional] For information how to get your keyId and access key turn to official aws docs: https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/setting-up.html

func New

func New(bucketName string) (*Storage, error)

New creates a new AWS S3 CDN saver

func NewWithUploader

func NewWithUploader(bucketName string, uploader s3manageriface.UploaderAPI) (*Storage, error)

NewWithUploader creates a new AWS S3 CDN saver with provided uploader

func (Storage) BaseURL

func (s Storage) BaseURL() *url.URL

BaseURL returns the base URL that stores all modules. It can be used in the "meta" tag redirect response to vgo.

For example:

<meta name="go-import" content="gomods.com/athens mod BaseURL()">

func (*Storage) Save

func (s *Storage) Save(ctx context.Context, module, version string, mod []byte, zip io.Reader, info []byte) error

Save implements the (github.com/gomods/athens/pkg/storage).Saver interface.

Jump to

Keyboard shortcuts

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