Api

package
v0.0.0-...-657618f Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2023 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Command = &cli.Command{
	Name:      "api",
	Usage:     "Manage api configuration",
	UsageText: "onesky [global options] api <command> [options]",
	Description: "Show information about api configuration: \n" +
		"			onesky api info\n\n" +
		"   Set options of api configuration: \n" +
		"			onesky set --url=\"https://management-api.onesky.app/v1\" --timeout=10\n",
	HideHelp:        true,
	HideHelpCommand: true,
	Subcommands: []*cli.Command{
		SubcommandInfo,
		SubcommandSet,
	},
}
View Source
var SubcommandInfo = &cli.Command{
	Name:        "info",
	Aliases:     []string{"i"},
	Action:      List,
	Description: "Show information about api configuration",
	Usage:       "Show information about api configuration",
	UsageText:   "onesky api info",
}
View Source
var SubcommandSet = &cli.Command{
	Name:        "set",
	Aliases:     []string{"s"},
	Action:      Set,
	Description: "Set options of api configuration",
	Usage:       "Set options of api configuration",
	UsageText:   "onesky api set",
	Flags: []cli.Flag{
		SubcommandSetFlagUrl,
		SubcommandSetFlagTimeout,
	},
}
View Source
var SubcommandSetFlagTimeout = &cli.IntFlag{
	Name:  "timeout",
	Usage: "`TIMEOUT` - Request timeout in seconds",
	Value: build.DefaultConfig.Api.Timeout,
}
View Source
var SubcommandSetFlagUrl = &cli.StringFlag{
	Name:  "url",
	Usage: "`URL` - Base url",
	Value: build.DefaultConfig.Api.Url,
}

Functions

func List

func List(c *cli.Context) (err error)

func Set

func Set(c *cli.Context) (e error)

Types

type Api

type Api interface {
	List(*cli.Context) error
	Set(*cli.Context) error
}

Jump to

Keyboard shortcuts

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