awslib

package
v0.0.0-...-8dc1d63 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AccountNumber

func AccountNumber(c Storage) (string, error)

AccountNumber .

func CreateBucket

func CreateBucket(c Storage) error

CreateBucket .

func DeleteObject

func DeleteObject(c Storage, bucket string, key string) error

DeleteObject .

func Download

func Download(c Storage, bucket string, key string) ([]byte, error)

Download .

func GetCallerIdentity

func GetCallerIdentity(c Storage) (*sts.GetCallerIdentityOutput, error)

GetCallerIdentity .

func SendMessage

func SendMessage(c Storage, phone, message string) error

SendMessage .

func Session

func Session(c Storage) *session.Session

Session returns an AWS session.

func Upload

func Upload(c Storage, bucket string, key string, file io.Reader) error

Upload .

Types

type Storage

type Storage struct {
	AccessKeyID     string    `json:"id"`
	SecretAccessKey string    `json:"secret"`
	SessionToken    string    `json:"session"`
	Region          string    `json:"region"`
	Bucket          string    `json:"bucket"`
	Expiration      time.Time `json:"expiration"`
}

Storage is S3 bucket storage.

func (Storage) Decrypted

func (c Storage) Decrypted(password string) (Storage, error)

Decrypted returns the storage object decrypted.

func (Storage) Encrypted

func (c Storage) Encrypted(password string) (Storage, error)

Encrypted returns the storage object encrypted.

func (Storage) Valid

func (c Storage) Valid() bool

Valid return true if the credentials are valid.

Jump to

Keyboard shortcuts

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