commands

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2019 License: Apache-2.0 Imports: 49 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// StandardScryptN is the N parameter of Scrypt encryption algorithm, using 256MB
	// memory and taking approximately 1s CPU time on a modern processor.
	StandardScryptN = 1 << 18

	// StandardScryptP is the P parameter of Scrypt encryption algorithm, using 256MB
	// memory and taking approximately 1s CPU time on a modern processor.
	StandardScryptP = 1

	// LightScryptN is the N parameter of Scrypt encryption algorithm, using 4MB
	// memory and taking approximately 100ms CPU time on a modern processor.
	LightScryptN = 1 << 12

	// LightScryptP is the P parameter of Scrypt encryption algorithm, using 4MB
	// memory and taking approximately 100ms CPU time on a modern processor.
	LightScryptP = 6
)

Variables

View Source
var AnkrCmd = &Command{
	Command: &cobra.Command{
		Use:   "ankrctl",
		Short: "ankrctl is a command line interface for the Ankr DCCN Hub.",
	},
}

AnkrCmd is the base command.

View Source
var Context string

Context holds the current auth context

View Source
var ErrNoAccessToken = errors.New("no access token has been configured")

ErrNoAccessToken is an error for when there is no access token.

View Source
var HubURL string

HubURL holds the HUB URL to use.

View Source
var Output string

Output holds the global output format.

View Source
var Token string

Token holds the global authorization token.

View Source
var Trace bool

Trace toggles http tracing output.

View Source
var Verbose bool

Verbose toggles verbose output.

View Source
var Writer = os.Stdout

Writer is where output should be written to.

Functions

func AddBoolFlag

func AddBoolFlag(cmd *Command, name, shorthand string, def bool, desc string, opts ...flagOpt)

AddBoolFlag adds a boolean flag to a command.

func AddIntFlag

func AddIntFlag(cmd *Command, name, shorthand string, def int, desc string, opts ...flagOpt)

AddIntFlag adds an integr flag to a command.

func AddStringFlag

func AddStringFlag(cmd *Command, name, shorthand, dflt, desc string, opts ...flagOpt)

AddStringFlag adds a string flag to a command.

func AddStringSliceFlag

func AddStringSliceFlag(cmd *Command, name, shorthand string, def []string, desc string, opts ...flagOpt)

AddStringSliceFlag adds a string slice flag to a command.

func AskForConfirm

func AskForConfirm(message string) error

AskForConfirm parses and verifies user input for confirmation.

func DecryptDataV3

func DecryptDataV3(cryptoJson CryptoJSON, auth string) ([]byte, error)

func Execute

func Execute()

Execute executes the current command using AnkrCmd.

func Keccak256

func Keccak256(data ...[]byte) []byte

func KeyFileWriter

func KeyFileWriter(keyFile string) (io.WriteCloser, error)

func RunAppCancel

func RunAppCancel(c *CmdConfig) error

RunAppCancel destroy a app by id.

func RunAppCreate

func RunAppCreate(c *CmdConfig) error

RunAppCreate creates a app. DCCN-CLI comput app create

func RunAppDetail

func RunAppDetail(c *CmdConfig) error

RunAppDetail returns a list of apps.

func RunAppList

func RunAppList(c *CmdConfig) error

RunAppList returns a list of apps.

func RunAppOverview

func RunAppOverview(c *CmdConfig) error

RunAppOverview returns a overview of apps.

func RunAppPurge

func RunAppPurge(c *CmdConfig) error

RunAppPurge purge a app from hub.

func RunAppUpdate

func RunAppUpdate(c *CmdConfig) error

RunAppUpdate updates a app.

func RunChartDelete

func RunChartDelete(c *CmdConfig) error

RunChartDelete delete a chart.

func RunChartDetail

func RunChartDetail(c *CmdConfig) error

RunChartDetail returns chart details.

func RunChartDownload

func RunChartDownload(c *CmdConfig) error

RunChartDownload download chart to local file system.

func RunChartList

func RunChartList(c *CmdConfig) error

RunChartList returns a list of chart.

func RunChartSaveas

func RunChartSaveas(c *CmdConfig) error

RunChartSaveas save as new version of chart with updated value.

func RunChartUpload

func RunChartUpload(c *CmdConfig) error

RunChartUpload upload a new chart.

func RunClusterList

func RunClusterList(c *CmdConfig) error

RunClusterList returns a list of cluster.

func RunNamespaceCreate

func RunNamespaceCreate(c *CmdConfig) error

RunNamespaceCreate create a namespace.

func RunNamespaceDelete

func RunNamespaceDelete(c *CmdConfig) error

RunNamespaceDelete delete a namespace.

func RunNamespaceList

func RunNamespaceList(c *CmdConfig) error

RunNamespaceList returns a list of namespace.

func RunNamespaceUpdate

func RunNamespaceUpdate(c *CmdConfig) error

RunNamespaceUpdate update the namespace setting.

func RunNetworkInfo

func RunNetworkInfo(c *CmdConfig) error

RunNetworkInfo returns a overview of apps.

func RunUserChangeEmail

func RunUserChangeEmail(c *CmdConfig) error

RunUserChangeEmail change password with new password.

func RunUserChangePassword

func RunUserChangePassword(c *CmdConfig) error

RunUserChangePassword change password with new password.

func RunUserConfirmEmail

func RunUserConfirmEmail(c *CmdConfig) error

RunUserConfirmEmail confirm user registration.

func RunUserConfirmPassword

func RunUserConfirmPassword(c *CmdConfig) error

RunUserConfirmPassword confirm password after reset.

func RunUserConfirmRegistration

func RunUserConfirmRegistration(c *CmdConfig) error

RunUserConfirmRegistration confirm user registration.

func RunUserDetail

func RunUserDetail(c *CmdConfig) error

RunUserDetail get user tail with wallet address.

func RunUserForgotPassword

func RunUserForgotPassword(c *CmdConfig) error

RunUserForgotPassword send request to request new password.

func RunUserLogin

func RunUserLogin(c *CmdConfig) error

RunUserLogin login user by email and password.

func RunUserLogout

func RunUserLogout(c *CmdConfig) error

RunUserLogout logout user.

func RunUserRegister

func RunUserRegister(c *CmdConfig) error

RunUserRegister register a user.

func RunUserTokenRefresh

func RunUserTokenRefresh(c *CmdConfig) error

RunUserTokenRefresh refresh token with new one.

func RunUserUpdate

func RunUserUpdate(c *CmdConfig) error

RunUserUpdate update user attribute.

func RunWalletDeletekey

func RunWalletDeletekey(c *CmdConfig) error

RunWalletDeletekey delete wallet key.

func RunWalletDepositHistory

func RunWalletDepositHistory(c *CmdConfig) error

RunWalletDepositHistory return deposit history for certain period.

func RunWalletGenAddress

func RunWalletGenAddress(c *CmdConfig) error

RunWalletGenAddress generate wallet key for deposit/withdraw.

func RunWalletGenkey

func RunWalletGenkey(c *CmdConfig) error

RunWalletGenkey generate wallet key.

func RunWalletGetbalance

func RunWalletGetbalance(c *CmdConfig) error

RunWalletGetbalance get balance from chain.

func RunWalletImportkey

func RunWalletImportkey(c *CmdConfig) error

RunWalletImportkey import wallet key.

func RunWalletKeylist

func RunWalletKeylist(c *CmdConfig) error

RunWalletKeylist list key in $HOME/.ankr

func RunWalletSearchDeposit

func RunWalletSearchDeposit(c *CmdConfig) error

RunWalletSearchDeposit search deposit for certain period.

func RunWalletSendCoins

func RunWalletSendCoins(c *CmdConfig) error

RunWalletSendtoken send token to other wallet address.

func Shuffle

func Shuffle(slice []string) []string

Types

type CmdConfig

type CmdConfig struct {
	NS   string
	Ankr ankrctl.Config
	Out  io.Writer
	Args []string
	// contains filtered or unexported fields
}

CmdConfig is a command configuration.

func NewCmdConfig

func NewCmdConfig(ns string, dc ankrctl.Config, out io.Writer, args []string) (*CmdConfig, error)

NewCmdConfig creates an instance of a CmdConfig.

func (*CmdConfig) Display

func (c *CmdConfig) Display(d displayers.Displayable) error

Display displayes the output from a command.

type CmdRunner

type CmdRunner func(*CmdConfig) error

CmdRunner runs a command and passes in a cmdConfig.

type Command

type Command struct {
	*cobra.Command

	// DocCategories are the documentation categories this command belongs to.
	DocCategories []string

	IsIndex bool
	// contains filtered or unexported fields
}

Command is a wrapper around cobra.Command that adds ankrctl specific functionality.

func CmdBuilder

func CmdBuilder(parent *Command, cr CmdRunner, cliText, desc string, out io.Writer, options ...cmdOption) *Command

CmdBuilder builds a new command.

func (*Command) AddCommand

func (c *Command) AddCommand(commands ...*Command)

AddCommand adds child commands and adds child commands for cobra as well.

func (*Command) ChildCommands

func (c *Command) ChildCommands() []*Command

ChildCommands returns the child commands.

type CryptoJSON

type CryptoJSON struct {
	Cipher       string                 `json:"cipher"`
	CipherText   string                 `json:"ciphertext"`
	CipherParams cipherparamsJSON       `json:"cipherparams"`
	KDF          string                 `json:"kdf"`
	KDFParams    map[string]interface{} `json:"kdfparams"`
	MAC          string                 `json:"mac"`
}

func EncryptDataV3

func EncryptDataV3(data, auth []byte, scryptN, scryptP int) (CryptoJSON, error)

type EncryptedKeyJSONV3

type EncryptedKeyJSONV3 struct {
	Name           string     `json:"name,omitempty"`
	Address        string     `json:"address"`
	PublicKey      string     `json:"publickey"`
	Crypto         CryptoJSON `json:"crypto"`
	KeyJSONVersion int        `json:"version"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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