command

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2019 License: MIT Imports: 38 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VERSION   = "version"
	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 (
	DEPLOYFUNCTION = "function"
	DEPLOYFN       = "fn"
	DEPLOYRESOURCE = "resource"
	DEPLOYR        = "r"
	DEPLOYSTORAGE  = "storage"
	DEPLOYSCHEDULE = "schedule"
	DEPLOYS        = "s"
	DEPLOYALL      = "all"
	DEPLOYHELP     = "help"
)
View Source
const (
	// Subcommands
	FUNCTIONCREATE  = "create"
	FUNCTIONDELETE  = "delete"
	FUNCTIONINVOKE  = "invoke"
	FUNCTIONDEPLOY  = "deploy"
	FUNCTIONMOUNT   = "mount"
	FUNCTIONUNMOUNT = "unmount"
	FUNCTIONLIST    = "list"
	FUNCTIONHELP    = "help"
	FUNCTIONLOG     = "log"
	FUNCTIONBUILD   = "build"
	FUNCTIONTEST    = "test"
	FUNCTIONRUN     = "run"
)
View Source
const (
	RESOURCECREATE = "create"
	RESOURCEDELETE = "delete"
	RESOURCEINVOKE = "invoke"
	RESOURCEDEPLOY = "deploy"
	RESOURCELIST   = "list"
	RESOURCEHELP   = "help"
)
View Source
const (
	SCHEDULERCREATE = "create"
	SCHEDULERDELETE = "delete"
	SCHEDULERDEPLOY = "deploy"
	SCHEDULERLIST   = "list"
	SCHEDULERATTACH = "attach"
	SCHEDULERDETACH = "detach"
	SCHEDULERHELP   = "help"
)
View Source
const (
	STAGECREATE = "create"
	STAGEDELETE = "delete"
	STAGEDEPLOY = "deploy"
	STAGELIST   = "list"
	STAGEHELP   = "help"
)
View Source
const (
	STORAGEDEPLOY  = "deploy"
	STORAGEMOUNT   = "mount"
	STORAGEUNMOUNT = "unmount"
)
View Source
const LAMBDARPCPORT = "6666"

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command interface {
	Run(ctx *args.Context) error
	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) error

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) error

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) error

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) error

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) error

#### Region

Destination AWS region which ginger create resources.

<<< 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) error

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) error

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) error

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) error

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) error

type Version added in v0.6.7

type Version struct {
	Command
}

Version is the struct that displays version info.

func NewVersion added in v0.6.7

func NewVersion() *Version

func (*Version) Help added in v0.6.7

func (v *Version) Help() string

func (*Version) Run added in v0.6.7

func (v *Version) Run(ctx *args.Context) error

Display build version.

>>> doc

## Show version

Show binary release version.

``` $ ginger version ```

<<< doc

Jump to

Keyboard shortcuts

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