ankrctl

package module
v0.0.0-...-1919117 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

README

Introduction

ankrctl is a command line interface for the Ankr's distributed cloud computing network to provide access to most account and app commands.

Usage:
  ankrctl [command]

Available Commands:
  app         app commands
  chart       chart commands
  cluster     cluster commands
  help        Help about any command
  namespace   namespace commands
  user        user commands
  wallet      wallet commands

Flags:
  -u, --hub-url string        Override default Ankr Hub endpoint
  -h, --help                  help for ankrctl

Use `ankrctl [command] --help` for more information about a command.

Prerequisites

You will need a local computer with ankrctl installed by following the project's installation instructions.

This reference is for the typical ankrctl's operations.

Invoking Commands

In ankrctl individual features are invoked by giving the utility a command, one or more sub-commands, and sometimes one or more options specifying particular values. Commands are grouped under three main categories:

  • user for user account operation and authentication
  • wallet for managing user's keys and tokens
  • app for managing user's application
  • cluster for managing user's cluster
  • chart for managing user's chart
  • namespace for managing user's chart

To see an overview of all commands, you can invoke ankrctl by itself. To see all available commands under one of the three main categories, you can use ankrctl category, like ankrctl app. For a usage guide on a specific command, enter the command with the --help flag, i.e. ankrctl app --help.

Documentation

Index

Constants

View Source
const (
	// ArgAccessToken is the access token to be used for the operations
	ArgAccessToken = "access-token"
	// ArgContext is the name of the auth context to use
	ArgContext = "context"
	// ArgUserID is a user id argument.
	ArgUserID = "userid"
	// ArgClusterNameSlug is a datacenter slug argument.
	ArgClusterNameSlug = "cluster-name"
	// ArgTypeSlug is a type slug argument.
	ArgTypeSlug = "type"
	// ArgFormat is columns to include in output argment.
	ArgFormat = "format"
	// ArgNoHeader hides the output header.
	ArgNoHeader = "no-header"
	// ArgOutput is an output type argument.
	ArgOutput = "output"
	// ArgForce forces confirmation on actions
	ArgForce = "force"
	// ArgAppIDSlug is a id slug argument.
	ArgAppIDSlug = "app-id"
	// ArgAppNameSlug is a name slug argument.
	ArgAppNameSlug = "app-name"
	// ArgNsIDSlug is a namespace id slug argument.
	ArgNsIDSlug = "ns-id"
	// ArgNsNameSlug is a namespace name slug argument.
	ArgNsNameSlug = "ns-name"
	// ArgNsCpuLimitSlug is a namespace cpu limit slug argument.
	ArgNsCpuLimitSlug = "cpu-limit"
	// ArgNsMemLimitSlug is a namespace mem limit slug argument.
	ArgNsMemLimitSlug = "mem-limit"
	// ArgNsStorageLimitSlug is a namespace storage limit slug argument.
	ArgNsStorageLimitSlug = "storage-limit"
	// ArgNsClusterIdSlug is a namespace cluster id slug argument.
	ArgNsClusterIDSlug = "ns-cluster-id"
	// ArgChartRepoSlug is a chart repo slug argument.
	ArgChartRepoSlug = "chart-repo"
	// ArgListRepoSlug is a chart list repo slug argument.
	ArgListRepoSlug = "list-repo"
	// ArgDetailRepoSlug is a chart detail repo slug argument.
	ArgDetailRepoSlug = "detail-repo"
	// ArgSourceRepoSlug is a saveas chart source repo slug argument.
	ArgSourceRepoSlug = "source-repo"
	// ArgSaveRepoSlug is a saveas chart save repo slug argument.
	ArgSaveRepoSlug = "save-repo"
	// ArgDownloadRepoSlug is a download chart repo slug argument.
	ArgDownloadRepoSlug = "download-repo"
	// ArgChartNameSlug is a chart image slug argument.
	ArgChartNameSlug = "chart-name"
	// ArgUploadVersionSlug is a chart upload version slug argument.
	ArgUploadVersionSlug = "upload-version"
	// ArgSourceNameSlug is a chart source image slug argument.
	ArgSourceNameSlug = "source-name"
	// ArgChartVersionSlug is a chart version slug argument.
	ArgChartVersionSlug = "chart-version"
	// ArgUpdateVersionSlug is a update app chart version slug argument.
	ArgUpdateVersionSlug = "update-version"
	// ArgDownloadVersionSlug is a download chart version slug argument.
	ArgDownloadVersionSlug = "download-version"
	// ArgDeleteVersionSlug is a download chart version slug argument.
	ArgDeleteVersionSlug = "delete-version"
	// ArgSourceVersionSlug is a saveas chart source version slug argument.
	ArgSourceVersionSlug = "source-version"
	// ArgSaveasVersionSlug is a chart saveas version slug argument.
	ArgSaveasVersionSlug = "saveas-version"
	// ArgShowVersionSlug is a chart detail show version slug argument.
	ArgShowVersionSlug = "show-version"
	// ArgChartFileSlug is a chart file slug argument.
	ArgChartFileSlug = "chart-file"
	// ArgUploadFileSlug is a chart file slug argument.
	ArgUploadFileSlug = "upload-file"
	// ArgValuesYamlSlug is a values file slug argument.
	ArgValuesYamlSlug = "values-yaml"
	// ArgPasswordSlug is a user password slug argument.
	ArgPasswordSlug = "password"
	// ArgEmailSlug is a user email slug argument.
	ArgEmailSlug = "email"
	// ArgAddressSlug is a wallet address slug argument.
	ArgAddressSlug = "address"
	// ArgTargetAddressSlug is a wallet send token target address slug argument.
	ArgTargetAddressSlug = "target-address"
	// ArgKeyStoreSlug is a wallet keystore slug argument.
	ArgKeyStoreSlug = "keystore"
	// ArgKeyNameSlug is a wallet key name slug argument.
	ArgKeyNameSlug = "keyname"
	// ArgPrivateKeySlug is a wallet private key slug argument.
	ArgPrivateKeySlug = "private-key"
	// ArgPublicKeySlug is a wallet public key slug argument.
	ArgPublicKeySlug = "public-key"
	// ArgAddressTypeSlug is a wallet address type slug argument.
	ArgAddressTypeSlug = "type"
	// ArgAddressPurposeSlug is a wallet address purpose slug argument.
	ArgAddressPurposeSlug = "purpose"
	// ArgSearchDepositStartSlug is a wallet search deposit start date slug argument.
	ArgSearchDepositStartSlug = "deposit-startdate"
	// ArgSearchDepositEndSlug is a wallet search deposit end date slug argument.
	ArgSearchDepositEndSlug = "deposit-enddate"
	// ArgRegisterCodeSlug is a user registration confirmation code slug argument.
	ArgRegisterCodeSlug = "register-code"
	// ArgPasswordCodeSlug is a password registration confirmation code slug argument.
	ArgPasswordCodeSlug = "password-code"
	// ArgConfirmPasswordSlug is a password reset confirmation new password slug argument.
	ArgConfirmPasswordSlug = "confirm-password"
	// ArgNewPasswordSlug is a change new password slug argument.
	ArgNewPasswordSlug = "new-password"
	// ArgOldPasswordSlug is a change old password slug argument.
	ArgOldPasswordSlug = "old-password"
	// ArgUpdateKeySlug is a update user attribute key slug argument.
	ArgUpdateKeySlug = "update-key"
	// ArgUpdateValueSlug is a update user attribute value slug argument.
	ArgUpdateValueSlug = "update-value"
	// ArgEmailCodeSlug is a confirm email change slug argument.
	ArgEmailCodeSlug = "email-code"
)
View Source
const (
	// ArgShortForce forces confirmation on actions
	ArgShortForce = "f"
)
View Source
const (
	// NSRoot is a configuration key that signifies this value is at the root.
	NSRoot = "ankrctl"
)

Variables

View Source
var (
	// AnkrConfig holds the app's current configuration.
	AnkrConfig Config = &LiveConfig{}

	// AnkrVersion is ankr's version.
	AnkrVersion = Version{
		Major: 1,
		Minor: 11,
		Patch: 0,
		Label: "dev",
	}

	// Build is ankr's build tag.
	Build string

	// Major is ankrctl's major version.
	Major string

	// Minor is ankrctl's minor version.
	Minor string

	// Patch is ankrctl's patch version.
	Patch string

	// Label is ankrctl's label.
	Label string
)

Functions

This section is empty.

Types

type Command

type Command interface {
	Run(args ...string) ([]byte, error)
	Start(args ...string) error
	Stop() error
}

Command runs commands.

type Config

type Config interface {
	Set(ns, key string, val interface{})
	IsSet(key string) bool
	GetString(ns, key string) (string, error)
	GetBool(ns, key string) (bool, error)
	GetInt(ns, key string) (int, error)
	GetStringSlice(ns, key string) ([]string, error)
}

Config is an interface that represent ankr's config.

type InvalidURNErr

type InvalidURNErr struct {
	URN string
}

InvalidURNErr is an error returned when their are too few arguments for a command.

func NewInvalidURNErr

func NewInvalidURNErr(urn string) *InvalidURNErr

NewInvalidURNErr creates a InvalidURNErr instance.

func (*InvalidURNErr) Error

func (e *InvalidURNErr) Error() string

type LiveCommand

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

LiveCommand is a live implementation of Command.

func NewLiveCommand

func NewLiveCommand(path string) *LiveCommand

NewLiveCommand creates a LiveCommand.

func (*LiveCommand) Run

func (c *LiveCommand) Run(args ...string) ([]byte, error)

Run runs a LiveCommand with args and returns stdout and an error if there was one.

func (*LiveCommand) Start

func (c *LiveCommand) Start(args ...string) error

Start runs a LiveCommand with args and starts it. This would most likely block, so you should call it in a goroutine.

func (*LiveCommand) Stop

func (c *LiveCommand) Stop() error

Stop stops an existing LiveCommand.

type LiveConfig

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

LiveConfig is an implementation of Config for live values.

func (*LiveConfig) GetBool

func (c *LiveConfig) GetBool(ns, key string) (bool, error)

GetBool returns a config value as a bool.

func (*LiveConfig) GetInt

func (c *LiveConfig) GetInt(ns, key string) (int, error)

GetInt returns a config value as an int.

func (*LiveConfig) GetString

func (c *LiveConfig) GetString(ns, key string) (string, error)

GetString returns a config value as a string.

func (*LiveConfig) GetStringSlice

func (c *LiveConfig) GetStringSlice(ns, key string) ([]string, error)

GetStringSlice returns a config value as a string slice.

func (*LiveConfig) IsSet

func (c *LiveConfig) IsSet(key string) bool

func (*LiveConfig) Set

func (c *LiveConfig) Set(ns, key string, val interface{})

Set sets a config key.

type MissingArgsErr

type MissingArgsErr struct {
	Command string
}

MissingArgsErr is an error returned when their are too few arguments for a command.

func NewMissingArgsErr

func NewMissingArgsErr(cmd string) *MissingArgsErr

NewMissingArgsErr creates a MissingArgsErr instance.

func (*MissingArgsErr) Error

func (e *MissingArgsErr) Error() string

type MockCommand

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

MockCommand is a mock command implementation. It allows you simulate running an external command.

func NewMockCommand

func NewMockCommand(path string) *MockCommand

NewMockCommand createsd a MockCommand.

func (*MockCommand) Run

func (c *MockCommand) Run(args ...string) ([]byte, error)

Run simulates the running of a command.

func (*MockCommand) Start

func (c *MockCommand) Start(args ...string) error

Start simulates starting a command.

func (*MockCommand) Stop

func (c *MockCommand) Stop() error

Stop simulates stoping a command.

type Version

type Version struct {
	Major, Minor, Patch int
	Name, Build, Label  string
}

Version is the version info for ankr.

func (Version) String

func (v Version) String() string

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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