Documentation ¶
Index ¶
- Constants
- func GetAssetFileKey(appID apps.AppID, version apps.AppVersion, name string) string
- func NewAWSSessionWithLogger(config *aws.Config, logger log) (*session.Session, error)
- type Client
- func (c *Client) CheckIfBucketExists(name string) (bool, error)
- func (c *Client) CreateBucket(bucket string) error
- func (c *Client) GetManifest(appID apps.AppID, version apps.AppVersion) (*apps.Manifest, error)
- func (c *Client) InvokeLambda(appID apps.AppID, appVersion apps.AppVersion, ...) ([]byte, error)
- func (c *Client) ProvisionApp(b []byte, shouldUpdate bool) error
- func (c *Client) ProvisionAppFromFile(path string, shouldUpdate bool) error
- func (c *Client) ProvisionAppFromURL(releaseURL string, shouldUpdate bool) error
- func (c *Client) RefreshService(awsAccessKeyID, awsSecretAccessKey string)
- func (c *Client) S3AssetDownload(item string) ([]byte, error)
- func (c *Client) S3FileDownload(bucket, item string) ([]byte, error)
- func (c *Client) S3FileUpload(key string, body io.Reader) error
- func (c *Client) SaveManifest(manifest *apps.Manifest) error
- func (c *Client) Service() *Service
- type Service
Constants ¶
const (
// DefaultRegion describes default region in aws
DefaultRegion = "us-east-2"
)
Variables ¶
This section is empty.
Functions ¶
func GetAssetFileKey ¶
GetAssetFileKey generates key for a specific asset in S3, key can be 1024 characters long.
Types ¶
type Client ¶
type Client struct { AppsS3Bucket string // contains filtered or unexported fields }
Client is a client for interacting with AWS resources.
func NewAWSClient ¶
func NewAWSClientWithConfig ¶
NewAWSClientWithConfig returns a new instance of Client with a custom configuration.
func (*Client) CheckIfBucketExists ¶
CheckIfBucketExists return true if a bucket with the given name exists. Otherwise it returns false.
func (*Client) CreateBucket ¶
CreateBucket creates a new s3 bucket.
func (*Client) GetManifest ¶
GetManifest returns a manifest file for an app from the S3.
func (*Client) InvokeLambda ¶
func (c *Client) InvokeLambda(appID apps.AppID, appVersion apps.AppVersion, functionName, invocationType string, payload []byte) ([]byte, error)
InvokeLambda runs a lambda function with specified name and returns a payload
func (*Client) ProvisionAppFromFile ¶
func (*Client) ProvisionAppFromURL ¶
ProvisionApp gets a release URL parses the release and creates an App in AWS releaseURL should contain a zip with lambda functions' zip files and a `manifest.json` ~/my_app.zip
|-- manifest.json |-- static |-- icon.png |-- coolFile.txt |-- my_nodejs_function.zip |-- index.js |-- node-modules |-- async |-- aws-sdk |-- my_python_function.zip |-- lambda_function.py |-- __pycache__ |-- certifi/
func (*Client) RefreshService ¶
RefreshService refreshes aws session using with new access key and secret.
func (*Client) S3AssetDownload ¶
S3AssetDownload is used to download app's static assets from the S3.
func (*Client) S3FileDownload ¶
S3FileDownload is used to download files from the S3.
func (*Client) S3FileUpload ¶
S3FileUpload uploads file to a specific S3 bucket
func (*Client) SaveManifest ¶
SaveManifest saves manifest file in S3