Documentation
¶
Index ¶
Constants ¶
const ( INIT = "init" INSTALL = "install" CONFIG = "config" DEPLOY = "deploy" D = "d" STAGE = "stage" ST = "st" // alias for "stage" FUNCTION = "function" FN = "fn" // alias for "function" RESOURCE = "resource" R = "r" // alias for "resource" STORAGE = "storage" S = "s" // alias for "storage" SCHEDULER = "scheduler" SC = "sc" // alias for schedule )
const ( DEPLOY_FUNCTION = "function" DEPLOY_FN = "fn" DEPLOY_RESOURCE = "resource" DEPLOY_R = "r" DEPLOY_STORAGE = "storage" DEPLOY_SCHEDULE = "schedule" DEPLOY_S = "s" DEPLOY_ALL = "all" DEPLOY_HELP = "help" )
const ( FUNCTION_CREATE = "create" FUNCTION_DELETE = "delete" FUNCTION_INVOKE = "invoke" FUNCTION_DEPLOY = "deploy" FUNCTION_MOUNT = "mount" FUNCTION_UNMOUNT = "unmount" FUNCTION_LIST = "list" FUNCTION_HELP = "help" FUNCTION_LOG = "log" )
const ( RESOURCE_CREATE = "create" RESOURCE_DELETE = "delete" RESOURCE_INVOKE = "invoke" RESOURCE_DEPLOY = "deploy" RESOURCE_LIST = "list" RESOURCE_HELP = "help" )
const ( SCHEDULER_CREATE = "create" SCHEDULER_DELETE = "delete" SCHEDULER_DEPLOY = "deploy" SCHEDULER_LIST = "list" SCHEDULER_ATTACH = "attach" SCHEDULER_DETACH = "detach" SCHEDULER_HELP = "help" )
const ( STAGE_CREATE = "create" STAGE_DELETE = "delete" STAGE_DEPLOY = "deploy" STAGE_LIST = "list" STAGE_HELP = "help" )
const ( STORAGE_DEPLOY = "deploy" STORAGE_MOUNT = "mount" STORAGE_UNMOUNT = "unmount" )
const COMMAND_HEADER = `` /* 167-byte string literal not displayed */
const PARALLEL_BUILD_NUM = 5
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Command ¶
Command is the interface implemented by structs that can run the command and show help as usage.
type Config ¶
type Config struct {
Command
// contains filtered or unexported fields
}
Config is a struct for update project configuration.
func (*Config) Run ¶
Run the config command.
>>> doc
## Update configuration
Update configurations by supplied command options.
``` $ ginger config [options] ```
| option | description | |:---------:|:----------------------------------------------------------------------------:| | --profile | Accout profile name. If empty, ginger uses `default` or environment variable | | --region | Region name to deploy | | --bucket | S3 bucket name | | --hook | Deploy hook command |
<<< doc
type Deploy ¶
type Deploy struct {
Command
// contains filtered or unexported fields
}
Deploy is the struct that manages function and api deployment. deploy syncs between local and AWS.
func (*Deploy) Run ¶
Run the deploy command
>>> doc
## Deploy all
Deploy all functions, resources, storage items.
``` $ ginger deploy all [options] ```
| option | description | |:-------:|:-------------------------------------------------------------------:| | --stage | Stage name. If this option is supplied, create deployment to stage. |
<<< doc
type Function ¶
type Function struct {
Command
// contains filtered or unexported fields
}
Function is the struct of AWS Lambda function operation command. This struct will be dispatched on "ginger fn/funtion" subcommand. This command operates with above constant string.
func NewFunction ¶
func NewFunction() *Function
type Init ¶
type Init struct {
Command
// contains filtered or unexported fields
}
Init is the struct for initalize ginger project. This command generates config file and some directory structure.
func (*Init) Run ¶
Run the init command.
>>> doc
## Initialize project
Initialize ginger project at current directory.
``` $ ginger init [options] ```
If you want to use (probably almost case yes) external Go package, we suggest you should put project directory under the `$GOPATH` to enable to detect vendor tree.
For example:
``` cd $GOATH/src/github.com/your/project ginger init ```
The ginger init command will work as following:
- Create `Ginger.toml` file which is used for project configuration - Create `functions` directory which is used for function management - Create `stages` directory which is used for stage variable management - Create `.ginger` directory which is used for put dependency packags. Those packages will be loaded on deploy phase.. - Install dependency packages.
Note that the `Ginger.toml` is readable and configurable, but almost values are added or updated via subcommands. So we don't recommend you change this file manually.
And, when initializing project, ginger asks two questions.
#### LambdaExecutionRole
When ginger deploys function to AWS Lambda, execution role is necessary. So you should input lambda exection role to use as default. You can create role on AWS IAM. See: https://docs.aws.amazon.com/lambda/latest/dg/with-s3-example-create-iam-role.html
Or, you can use specific role by each function by adding `Function.toml`.
#### S3BucketName
ginger uses S3 bucket name project director name as defaut. You can change this name.
<<< doc
type Install ¶
type Install struct {
Command
// contains filtered or unexported fields
}
Install is the struct for install ginger project dependencies. This command installs project dependencies.
func NewInstall ¶
func NewInstall() *Install
type Resource ¶
type Resource struct {
Command
// contains filtered or unexported fields
}
Resource is the struct of AWS API Gateway resource management command. This struct will be dispatched on "ginger resource" subcommand. This command operates with above constant string.
func NewResource ¶
func NewResource() *Resource
type Scheduler ¶
type Scheduler struct {
Command
// contains filtered or unexported fields
}
Schduler is the struct of AWS CloudWatchEvents management command. This struct will be dispatched on "ginger schedule" subcommand.
func NewScheduler ¶
func NewScheduler() *Scheduler