commands

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2017 License: Apache-2.0 Imports: 17 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// JSON .
	JSON = strings.ToLower(utils.JSON)
	// YAML .
	YAML = strings.ToLower(utils.YAML)
	// TABLE .
	TABLE = "table"
)

Functions

func NewController

func NewController(ctx *cli.Context) (*ctrl.Client, error)

NewController .

func ValidateControllerURL

func ValidateControllerURL(ctx *cli.Context) (string, error)

ValidateControllerURL .

Types

type ActionListCommand

type ActionListCommand struct {
	// contains filtered or unexported fields
}

ActionListCommand is used for the action-list command.

func NewActionListCommand

func NewActionListCommand(term terminal.UI) (cmd *ActionListCommand)

NewActionListCommand constructs a new Action List.

func (*ActionListCommand) Action

func (cmd *ActionListCommand) Action(ctx *cli.Context) error

Action runs when no subcommands are specified https://godoc.org/github.com/urfave/cli#ActionFunc

func (*ActionListCommand) ActionTable

func (cmd *ActionListCommand) ActionTable(filter *api.RuleFilter) error

ActionTable prints the list of actions as a table. +-------------+----------------+----------------------+----------+-----------------------------+--------------------------------------+ | Destination | Source | Headers | Priority | Actions | Rule Id | +-------------+----------------+----------------------+----------+-----------------------------+--------------------------------------+ | reviews | productpage:v1 | Cookie:.*?user=jason | 10 | v2(trace) | 2d381a94-1796-45c3-a1d8-3965051b61b1 | | ratings | reviews:v2 | Cookie:.*?user=jason | 10 | v1(trace), v1(1->delay=7.0) | 454a8fb0-d260-4832-8007-5b5344c03c1f | | ratings | reviews:v2 | Cookie:.*?user=jason | 10 | v1(1.0->delay=7.0) | c2d98e32-8fd0-4e0d-a363-8adff99b0692 | | details | productpage:v1 | Cookie:.*?user=jason | 10 | v1(trace) | 9c7198d7-d037-4cb6-8d48-b573608c7de9 | | productpage | gateway | Cookie:.*?user=jason | 10 | v1(trace) | 0f12b977-9ab9-4d69-8dfe-3eae07c8f115 | +-------------+----------------+----------------------+----------+-----------------------------+--------------------------------------+

func (*ActionListCommand) Before

func (cmd *ActionListCommand) Before(ctx *cli.Context) error

Before runs before the Action https://godoc.org/github.com/urfave/cli#BeforeFunc

func (*ActionListCommand) DefaultAction

func (cmd *ActionListCommand) DefaultAction(ctx *cli.Context) error

DefaultAction runs the default action.

func (*ActionListCommand) GetMetadata

func (cmd *ActionListCommand) GetMetadata() cli.Command

GetMetadata returns the metadata.

func (*ActionListCommand) OnUsageError

func (cmd *ActionListCommand) OnUsageError(ctx *cli.Context, err error, isSubcommand bool) error

OnUsageError is executed if an usage error occurs.

func (*ActionListCommand) PrettyPrint

func (cmd *ActionListCommand) PrettyPrint(filter *api.RuleFilter, format string) error

PrettyPrint prints the list of services in the given format (json or yaml).

type InfoCommand

type InfoCommand struct {
	// contains filtered or unexported fields
}

InfoCommand is ised for the info command.

func NewInfoCommand

func NewInfoCommand(term terminal.UI) (cmd *InfoCommand)

NewInfoCommand constructs a new Info.

func (*InfoCommand) Action

func (cmd *InfoCommand) Action(ctx *cli.Context) error

Action runs when no subcommands are specified https://godoc.org/github.com/urfave/cli#ActionFunc

func (*InfoCommand) Before

func (cmd *InfoCommand) Before(ctx *cli.Context) error

Before runs before the Action https://godoc.org/github.com/urfave/cli#BeforeFunc

func (*InfoCommand) DefaultAction

func (cmd *InfoCommand) DefaultAction(ctx *cli.Context) error

DefaultAction prints information about the controller URL's and tokens. Amalgam8 info...

+---------------------+----------------------------+ | Env. Variable | Value | +---------------------+----------------------------+ | A8_CONTROLLER_URL | http://192.168.0.100:31200 | | A8_CONTROLLER_TOKEN | | | A8_GREMLIN_URL | http://192.168.0.100:31500 | | A8_GREMLIN_TOKEN | | | A8_DEBUG | false | +---------------------+----------------------------+

func (*InfoCommand) GetMetadata

func (cmd *InfoCommand) GetMetadata() cli.Command

GetMetadata returns the metadata.

func (*InfoCommand) OnUsageError

func (cmd *InfoCommand) OnUsageError(ctx *cli.Context, err error, isSubcommand bool) error

OnUsageError is executed if an usage error occurs.

type RecipeRunCommand

type RecipeRunCommand struct {
	// contains filtered or unexported fields
}

RecipeRunCommand is ised for the recipe-run command.

func NewRecipeRunCommand

func NewRecipeRunCommand(term terminal.UI) (cmd *RecipeRunCommand)

NewRecipeRunCommand constructs a new RecipeRun.

func (*RecipeRunCommand) Action

func (cmd *RecipeRunCommand) Action(ctx *cli.Context) error

Action runs when no subcommands are specified https://godoc.org/github.com/urfave/cli#ActionFunc

func (*RecipeRunCommand) Before

func (cmd *RecipeRunCommand) Before(ctx *cli.Context) error

Before runs before the Action https://godoc.org/github.com/urfave/cli#BeforeFunc

func (*RecipeRunCommand) DefaultAction

func (cmd *RecipeRunCommand) DefaultAction(ctx *cli.Context) error

DefaultAction .

func (*RecipeRunCommand) GetMetadata

func (cmd *RecipeRunCommand) GetMetadata() cli.Command

GetMetadata returns the metadata.

func (*RecipeRunCommand) OnUsageError

func (cmd *RecipeRunCommand) OnUsageError(ctx *cli.Context, err error, isSubcommand bool) error

OnUsageError is executed if an usage error occurs.

func (*RecipeRunCommand) RecipeResultsTable

func (cmd *RecipeRunCommand) RecipeResultsTable(results *api.RecipeResults) error

RecipeResultsTable .

type RouteListCommand

type RouteListCommand struct {
	// contains filtered or unexported fields
}

RouteListCommand is used for the route-list command.

func NewRouteListCommand

func NewRouteListCommand(term terminal.UI) (cmd *RouteListCommand)

NewRouteListCommand constructs a new Route List.

func (*RouteListCommand) Action

func (cmd *RouteListCommand) Action(ctx *cli.Context) error

Action runs when no subcommands are specified https://godoc.org/github.com/urfave/cli#ActionFunc

func (*RouteListCommand) Before

func (cmd *RouteListCommand) Before(ctx *cli.Context) error

Before runs before the Action https://godoc.org/github.com/urfave/cli#BeforeFunc

func (*RouteListCommand) DefaultAction

func (cmd *RouteListCommand) DefaultAction(ctx *cli.Context) error

DefaultAction runs the default action.

func (*RouteListCommand) GetMetadata

func (cmd *RouteListCommand) GetMetadata() cli.Command

GetMetadata returns the metadata.

func (*RouteListCommand) OnUsageError

func (cmd *RouteListCommand) OnUsageError(ctx *cli.Context, err error, isSubcommand bool) error

OnUsageError is executed if an usage error occurs.

func (*RouteListCommand) PrettyPrint

func (cmd *RouteListCommand) PrettyPrint(filter *api.RuleFilter, format string) error

PrettyPrint prints the list of services in the given format (json or yaml).

func (*RouteListCommand) RouteTable

func (cmd *RouteListCommand) RouteTable(filter *api.RuleFilter) error

RouteTable prints the a list of routes as a table. +------------------+-----------------+----------------------+ | Service | Default Version | Version Selectors | +------------------+-----------------+----------------------+ | json_destination | v21,v22,json | v2(user="test") | | productpage | v2 | v2(header="Foo:bar") | | details | v1 | | | reviews | v2 | | | ratings | | | +------------------+-----------------+----------------------+

type RuleCreateCommand

type RuleCreateCommand struct {
	// contains filtered or unexported fields
}

RuleCreateCommand is used for the rule-create command.

func NewRuleCreateCommand

func NewRuleCreateCommand(term terminal.UI) (cmd *RuleCreateCommand)

NewRuleCreateCommand constructs a new Rule Create.

func (*RuleCreateCommand) Action

func (cmd *RuleCreateCommand) Action(ctx *cli.Context) error

Action runs when no subcommands are specified https://godoc.org/github.com/urfave/cli#ActionFunc

func (*RuleCreateCommand) Before

func (cmd *RuleCreateCommand) Before(ctx *cli.Context) error

Before runs before the Action https://godoc.org/github.com/urfave/cli#BeforeFunc

func (*RuleCreateCommand) DefaultAction

func (cmd *RuleCreateCommand) DefaultAction(ctx *cli.Context) error

DefaultAction captures the rules provided in the terminal.

func (*RuleCreateCommand) GetMetadata

func (cmd *RuleCreateCommand) GetMetadata() cli.Command

GetMetadata returns the metadata.

func (*RuleCreateCommand) OnUsageError

func (cmd *RuleCreateCommand) OnUsageError(ctx *cli.Context, err error, isSubcommand bool) error

OnUsageError is executed if an usage error occurs.

type RuleDeleteCommand

type RuleDeleteCommand struct {
	// contains filtered or unexported fields
}

RuleDeleteCommand is used for the rule-delete command.

func NewRuleDeleteCommand

func NewRuleDeleteCommand(term terminal.UI) (cmd *RuleDeleteCommand)

NewRuleDeleteCommand constructs a new Rule Delete command.

func (*RuleDeleteCommand) Action

func (cmd *RuleDeleteCommand) Action(ctx *cli.Context) error

Action runs when no subcommands are specified https://godoc.org/github.com/urfave/cli#ActionFunc

func (*RuleDeleteCommand) Before

func (cmd *RuleDeleteCommand) Before(ctx *cli.Context) error

Before runs before the Action https://godoc.org/github.com/urfave/cli#BeforeFunc

func (*RuleDeleteCommand) DefaultAction

func (cmd *RuleDeleteCommand) DefaultAction(ctx *cli.Context) error

DefaultAction runs the default action.

func (*RuleDeleteCommand) DeleteRules

func (cmd *RuleDeleteCommand) DeleteRules(filter *api.RuleFilter) error

DeleteRules deletes the rules based on the given query.

func (*RuleDeleteCommand) GetMetadata

func (cmd *RuleDeleteCommand) GetMetadata() cli.Command

GetMetadata returns the metadata.

func (*RuleDeleteCommand) OnUsageError

func (cmd *RuleDeleteCommand) OnUsageError(ctx *cli.Context, err error, isSubcommand bool) error

OnUsageError is executed if an usage error occurs.

type RuleGetCommand

type RuleGetCommand struct {
	// contains filtered or unexported fields
}

RuleGetCommand is used for the rule-get command.

func NewRuleGetCommand

func NewRuleGetCommand(term terminal.UI) (cmd *RuleGetCommand)

NewRuleGetCommand constructs a new Rule Get command.

func (*RuleGetCommand) Action

func (cmd *RuleGetCommand) Action(ctx *cli.Context) error

Action runs when no subcommands are specified https://godoc.org/github.com/urfave/cli#ActionFunc

func (*RuleGetCommand) Before

func (cmd *RuleGetCommand) Before(ctx *cli.Context) error

Before runs before the Action https://godoc.org/github.com/urfave/cli#BeforeFunc

func (*RuleGetCommand) DefaultAction

func (cmd *RuleGetCommand) DefaultAction(ctx *cli.Context) error

DefaultAction runs the default action.

func (*RuleGetCommand) GetMetadata

func (cmd *RuleGetCommand) GetMetadata() cli.Command

GetMetadata returns the metada.

func (*RuleGetCommand) OnUsageError

func (cmd *RuleGetCommand) OnUsageError(ctx *cli.Context, err error, isSubcommand bool) error

OnUsageError is executed if an usage error occurs.

func (*RuleGetCommand) PrettyPrint

func (cmd *RuleGetCommand) PrettyPrint(filter *api.RuleFilter, format string) error

PrettyPrint prints the rules returned by the controller in given format.

type RuleUpdateCommand

type RuleUpdateCommand struct {
	// contains filtered or unexported fields
}

RuleUpdateCommand is used for the rule-update command.

func NewRuleUpdateCommand

func NewRuleUpdateCommand(term terminal.UI) (cmd *RuleUpdateCommand)

NewRuleUpdateCommand constructs a new Rule Update.

func (*RuleUpdateCommand) Action

func (cmd *RuleUpdateCommand) Action(ctx *cli.Context) error

Action runs when no subcommands are specified https://godoc.org/github.com/urfave/cli#ActionFunc

func (*RuleUpdateCommand) Before

func (cmd *RuleUpdateCommand) Before(ctx *cli.Context) error

Before runs before the Action https://godoc.org/github.com/urfave/cli#BeforeFunc

func (*RuleUpdateCommand) DefaultAction

func (cmd *RuleUpdateCommand) DefaultAction(ctx *cli.Context) error

DefaultAction captures the rules provided in the terminal.

func (*RuleUpdateCommand) GetMetadata

func (cmd *RuleUpdateCommand) GetMetadata() cli.Command

GetMetadata returns the metadata.

func (*RuleUpdateCommand) OnUsageError

func (cmd *RuleUpdateCommand) OnUsageError(ctx *cli.Context, err error, isSubcommand bool) error

OnUsageError is executed if an usage error occurs.

type ServiceInstancesList

type ServiceInstancesList struct {
	Service   string   `json:"service" yaml:"service"`
	Instances []string `json:"instances" yaml:"instances"`
}

ServiceInstancesList .

Jump to

Keyboard shortcuts

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