Documentation ¶
Index ¶
- type Client
- func (c *Client) CreateApp(appName string) *objects.App
- func (c *Client) DescribeEnvVars(appName string) (map[string]string, error)
- func (c *Client) DescribeLogs(appName string, options *options.DescribeLogs) ([]*log.Log, error)
- func (c *Client) DestroyApp(appName string) error
- func (c *Client) GetApp(appName string) (*objects.App, error)
- func (c *Client) GetAppCreationProgress(appName string) int
- func (c *Client) GetAppDeletionProgress(appName string) int
- func (c *Client) GetAppInfo(appName string) (*objects.AppInfo, error)
- func (c *Client) GetTemplate(appName string) string
- func (c *Client) ListApps() []*objects.App
- func (c *Client) SetEnvVars(appName string, envVars map[string]string) error
- func (c *Client) StackExists(stackName string) bool
- func (c *Client) UnsetEnvVars(appName string, envList []string) error
- type ClientOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the Herogate API client. This is a wrapper of AWS API clients.
func NewClient ¶
func NewClient(option *ClientOption) *Client
NewClient initializes a new client from AWS config.
func (*Client) CreateApp ¶
CreateApp creates a new CloudFormation stack and wait until stack create complete. When the stack is created, returns ALB endpoint URL and CodeCommit URL. If the stack creation is failed, delete this stack.
func (*Client) DescribeEnvVars ¶
DescribeEnvVars describes environment variables from container deifinitions.
func (*Client) DescribeLogs ¶
DescribeLogs returns the Herogate application logs. In this function, it calls CodeBuild API, CloudWatchLogs API, and ECS Service API internally and sorts logs by timestamps.
func (*Client) DestroyApp ¶
DestroyApp destroys resources in the following order:
- S3 Bucket - ECR Repository - CloudFormation Stack
This function waits until stack deletion complete.
func (*Client) GetApp ¶
GetApp returns the application object. If the application not found, returns nil and error.
func (*Client) GetAppCreationProgress ¶
GetAppCreationProgress returns the creation progress of the application. This function calculates the proportion of resources that are "CREATE_COMPLETE".
func (*Client) GetAppDeletionProgress ¶
GetAppDeletionProgress returns the deletion progress of the application. This function calculates the proportion of resources that are "DELETE_COMPLETE".
func (*Client) GetAppInfo ¶
GetAppInfo returns the application info object. If the application not found, returns nil and error. The difference from `GetApp` is to include container's details, platform version, etc.
func (*Client) GetTemplate ¶
GetTemplate is wrapper for cloudformation.GetTemplate
func (*Client) SetEnvVars ¶
SetEnvVars updates CloudFormation stack with new environment variables. It generates new template by adding or merging environment variables from existing template. When the template did not change, it does not perform updates. Because this operation restarts existing containers, It takes time to complete.
func (*Client) StackExists ¶
StackExists returns whether or not the stack exists.
func (*Client) UnsetEnvVars ¶
UnsetEnvVars updates CloudFormation stack with new environment variables. It generates new template by deleting environment variables from existing template. When the template did not change, it does not perform updates. Because this operation restarts existing containers, It takes time to complete.
type ClientOption ¶
type ClientOption struct {
Region string
}
ClientOption is options for Herogate API Client. Regions can specify regions used in AWS.