command

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2018 License: MIT Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
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
)
View Source
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"
)
View Source
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"
)
View Source
const (
	RESOURCE_CREATE = "create"
	RESOURCE_DELETE = "delete"
	RESOURCE_INVOKE = "invoke"
	RESOURCE_DEPLOY = "deploy"
	RESOURCE_LIST   = "list"
	RESOURCE_HELP   = "help"
)
View Source
const (
	SCHEDULER_CREATE = "create"
	SCHEDULER_DELETE = "delete"
	SCHEDULER_DEPLOY = "deploy"
	SCHEDULER_LIST   = "list"
	SCHEDULER_ATTACH = "attach"
	SCHEDULER_DETACH = "detach"
	SCHEDULER_HELP   = "help"
)
View Source
const (
	STAGE_CREATE = "create"
	STAGE_DELETE = "delete"
	STAGE_DEPLOY = "deploy"
	STAGE_LIST   = "list"
	STAGE_HELP   = "help"
)
View Source
const (
	STORAGE_DEPLOY  = "deploy"
	STORAGE_MOUNT   = "mount"
	STORAGE_UNMOUNT = "unmount"
)
View Source
const COMMAND_HEADER = `` /* 167-byte string literal not displayed */
View Source
const PARALLEL_BUILD_NUM = 5

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command interface {
	Run(ctx *args.Context)
	Help() string
}

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 NewConfig

func NewConfig() *Config

func (*Config) Help

func (c *Config) Help() string

Show this command help.

func (*Config) Run

func (c *Config) Run(ctx *args.Context)

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 NewDeploy

func NewDeploy() *Deploy

func (*Deploy) Help

func (d *Deploy) Help() string

Show deloy command help

func (*Deploy) Run

func (d *Deploy) Run(ctx *args.Context)

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

func (*Function) Help

func (f *Function) Help() string

Show function command help.

func (*Function) Run

func (f *Function) Run(ctx *args.Context)

Run the command.

type Help

type Help struct {
	Command
}

Help is the struct that displays global command usage.

func NewHelp

func NewHelp() *Help

func (*Help) Help

func (h *Help) Help() string

func (*Help) Run

func (h *Help) Run(ctx *args.Context)

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 NewInit

func NewInit() *Init

func (*Init) Help

func (i *Init) Help() string

Display init command help.

func (*Init) Run

func (i *Init) Run(ctx *args.Context)

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

func (*Install) Help

func (i *Install) Help() string

func (*Install) Run

func (i *Install) Run(ctx *args.Context)

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

func (*Resource) Help

func (r *Resource) Help() string

Display help string

func (*Resource) Run

func (r *Resource) Run(ctx *args.Context)

Run runs command with some options

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

func (*Scheduler) Help

func (s *Scheduler) Help() string

Show function command help.

func (*Scheduler) Run

func (s *Scheduler) Run(ctx *args.Context)

Run the command.

type Stage

type Stage struct {
	Command
	// contains filtered or unexported fields
}

Stage is the struct of AWS API Gateway stage operation command. This struct will be dispatched on "ginger stage" subcommand.

func NewStage

func NewStage() *Stage

func (*Stage) Help

func (s *Stage) Help() string

Show function command help.

func (*Stage) Run

func (s *Stage) Run(ctx *args.Context)

Run the command.

type Storage

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

func NewStorage

func NewStorage() *Storage

func (*Storage) Help

func (s *Storage) Help() string

func (*Storage) Run

func (s *Storage) Run(ctx *args.Context)

Jump to

Keyboard shortcuts

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