Documentation ¶
Index ¶
- Variables
- func AlertsCommand() subcommands.Command
- func AlertsListCommand() subcommands.Command
- func AlertsPostCommand() subcommands.Command
- func AlertsPostJSONCommand() subcommands.Command
- func Call(ctx context.Context, method, api string, j interface{}) ([]byte, error)
- func FiltersCommand() subcommands.Command
- func FiltersDeleteCommand() subcommands.Command
- func FiltersDisableCommand() subcommands.Command
- func FiltersEnableCommand() subcommands.Command
- func FiltersInactivateCommand() subcommands.Command
- func FiltersListCommand() subcommands.Command
- func FiltersPutCommand() subcommands.Command
- func FiltersShowCommand() subcommands.Command
- func NewCommander(f *flag.FlagSet, name string) *subcommands.Commander
- func RoutesCommand() subcommands.Command
- func RoutesListCommand() subcommands.Command
- func RoutesPutCommand() subcommands.Command
- func RoutesShowCommand() subcommands.Command
- func Setup(u *url.URL, token string)
- func VersionCommand() subcommands.Command
- type Command
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNotFound indicates kkok server returned 404. ErrNotFound = errors.New("not found") )
Functions ¶
func AlertsCommand ¶
func AlertsCommand() subcommands.Command
AlertsCommand implements "alerts" subcommand.
func AlertsListCommand ¶
func AlertsListCommand() subcommands.Command
AlertsListCommand implements "alerts list" subcommand.
func AlertsPostCommand ¶
func AlertsPostCommand() subcommands.Command
AlertsPostCommand implements "alerts post" subcommand.
func AlertsPostJSONCommand ¶
func AlertsPostJSONCommand() subcommands.Command
AlertsPostJSONCommand implements "alerts postJSON" subcommand.
func Call ¶
Call makes a REST API call to kkok server. method is HTTP method. api is API request path such as /version. If j is []byte, it will be used as the request body. If j is not []byte nor nil, it will be encoded into JSON and be used as request body.
If server returns 200, this returns the response body and nil. If server returns 404, this returns nil and ErrNotFound. For other status codes, this will return non-nil errors.
func FiltersCommand ¶
func FiltersCommand() subcommands.Command
FiltersCommand implements "filters" subcommand.
func FiltersDeleteCommand ¶
func FiltersDeleteCommand() subcommands.Command
FiltersDeleteCommand implements "filters delete" subcommand.
func FiltersDisableCommand ¶
func FiltersDisableCommand() subcommands.Command
FiltersDisableCommand implements "filters disable" subcommand.
func FiltersEnableCommand ¶
func FiltersEnableCommand() subcommands.Command
FiltersEnableCommand implements "filters enable" subcommand.
func FiltersInactivateCommand ¶
func FiltersInactivateCommand() subcommands.Command
FiltersInactivateCommand implements "filters inactivate" subcommand.
func FiltersListCommand ¶
func FiltersListCommand() subcommands.Command
FiltersListCommand implements "filters list" subcommand.
func FiltersPutCommand ¶
func FiltersPutCommand() subcommands.Command
FiltersPutCommand implements "filters put" subcommand.
func FiltersShowCommand ¶
func FiltersShowCommand() subcommands.Command
FiltersShowCommand implements "filters show" subcommand.
func NewCommander ¶
func NewCommander(f *flag.FlagSet, name string) *subcommands.Commander
NewCommander creates a subcommands.Commander for nested sub commands. This registers "flags" and "help" sub commands for the new commander.
func RoutesCommand ¶
func RoutesCommand() subcommands.Command
RoutesCommand implements "routes" subcommand.
func RoutesListCommand ¶
func RoutesListCommand() subcommands.Command
RoutesListCommand implements "routes list" subcommand.
func RoutesPutCommand ¶
func RoutesPutCommand() subcommands.Command
RoutesPutCommand implements "routes put" subcommand.
func RoutesShowCommand ¶
func RoutesShowCommand() subcommands.Command
RoutesShowCommand implements "routes show" subcommand.
func VersionCommand ¶
func VersionCommand() subcommands.Command
VersionCommand implements "version" subcommand.
Types ¶
type Command ¶
type Command interface { SetFlags(f *flag.FlagSet) Execute(ctx context.Context, f *flag.FlagSet) subcommands.ExitStatus }
Command is the interface for NewCommand