Documentation ¶
Index ¶
- Constants
- Variables
- func AddBoolFlag(cmd *Command, name, shorthand string, def bool, desc string, opts ...flagOpt)
- func AddIntFlag(cmd *Command, name, shorthand string, def int, desc string, opts ...flagOpt)
- func AddStringFlag(cmd *Command, name, shorthand, dflt, desc string, opts ...flagOpt)
- func AddStringSliceFlag(cmd *Command, name, shorthand string, def []string, desc string, ...)
- func AskForConfirm(message string) error
- func DecryptDataV3(cryptoJson CryptoJSON, auth string) ([]byte, error)
- func Execute()
- func Keccak256(data ...[]byte) []byte
- func KeyFileWriter(keyFile string) (io.WriteCloser, error)
- func RunAppCancel(c *CmdConfig) error
- func RunAppCreate(c *CmdConfig) error
- func RunAppDetail(c *CmdConfig) error
- func RunAppList(c *CmdConfig) error
- func RunAppOverview(c *CmdConfig) error
- func RunAppPurge(c *CmdConfig) error
- func RunAppUpdate(c *CmdConfig) error
- func RunChartDelete(c *CmdConfig) error
- func RunChartDetail(c *CmdConfig) error
- func RunChartDownload(c *CmdConfig) error
- func RunChartList(c *CmdConfig) error
- func RunChartSaveas(c *CmdConfig) error
- func RunChartUpload(c *CmdConfig) error
- func RunClusterList(c *CmdConfig) error
- func RunNamespaceCreate(c *CmdConfig) error
- func RunNamespaceDelete(c *CmdConfig) error
- func RunNamespaceList(c *CmdConfig) error
- func RunNamespaceUpdate(c *CmdConfig) error
- func RunNetworkInfo(c *CmdConfig) error
- func RunUserChangeEmail(c *CmdConfig) error
- func RunUserChangePassword(c *CmdConfig) error
- func RunUserConfirmEmail(c *CmdConfig) error
- func RunUserConfirmPassword(c *CmdConfig) error
- func RunUserConfirmRegistration(c *CmdConfig) error
- func RunUserDetail(c *CmdConfig) error
- func RunUserForgotPassword(c *CmdConfig) error
- func RunUserLogin(c *CmdConfig) error
- func RunUserLogout(c *CmdConfig) error
- func RunUserRegister(c *CmdConfig) error
- func RunUserTokenRefresh(c *CmdConfig) error
- func RunUserUpdate(c *CmdConfig) error
- func RunWalletDeletekey(c *CmdConfig) error
- func RunWalletDepositHistory(c *CmdConfig) error
- func RunWalletGenAddress(c *CmdConfig) error
- func RunWalletGenkey(c *CmdConfig) error
- func RunWalletGetbalance(c *CmdConfig) error
- func RunWalletImportkey(c *CmdConfig) error
- func RunWalletKeylist(c *CmdConfig) error
- func RunWalletSearchDeposit(c *CmdConfig) error
- func RunWalletSendCoins(c *CmdConfig) error
- func Shuffle(slice []string) []string
- type CmdConfig
- type CmdRunner
- type Command
- type CryptoJSON
- type EncryptedKeyJSONV3
Constants ¶
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 ¶
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.
var Context string
Context holds the current auth context
var ErrNoAccessToken = errors.New("no access token has been configured")
ErrNoAccessToken is an error for when there is no access token.
var HubURL string
HubURL holds the HUB URL to use.
var Output string
Output holds the global output format.
var Token string
Token holds the global authorization token.
var Trace bool
Trace toggles http tracing output.
var Verbose bool
Verbose toggles verbose output.
var Writer = os.Stdout
Writer is where output should be written to.
Functions ¶
func AddBoolFlag ¶
AddBoolFlag adds a boolean flag to a command.
func AddIntFlag ¶
AddIntFlag adds an integr flag to a command.
func AddStringFlag ¶
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 ¶
AskForConfirm parses and verifies user input for confirmation.
func DecryptDataV3 ¶
func DecryptDataV3(cryptoJson CryptoJSON, auth string) ([]byte, error)
func KeyFileWriter ¶
func KeyFileWriter(keyFile string) (io.WriteCloser, error)
func RunAppCreate ¶
RunAppCreate creates a app. DCCN-CLI comput app create
func RunAppOverview ¶
RunAppOverview returns a overview of apps.
func RunChartDownload ¶
RunChartDownload download chart to local file system.
func RunChartSaveas ¶
RunChartSaveas save as new version of chart with updated value.
func RunClusterList ¶
RunClusterList returns a list of cluster.
func RunNamespaceCreate ¶
RunNamespaceCreate create a namespace.
func RunNamespaceDelete ¶
RunNamespaceDelete delete a namespace.
func RunNamespaceList ¶
RunNamespaceList returns a list of namespace.
func RunNamespaceUpdate ¶
RunNamespaceUpdate update the namespace setting.
func RunNetworkInfo ¶
RunNetworkInfo returns a overview of apps.
func RunUserChangeEmail ¶
RunUserChangeEmail change password with new password.
func RunUserChangePassword ¶
RunUserChangePassword change password with new password.
func RunUserConfirmEmail ¶
RunUserConfirmEmail confirm user registration.
func RunUserConfirmPassword ¶
RunUserConfirmPassword confirm password after reset.
func RunUserConfirmRegistration ¶
RunUserConfirmRegistration confirm user registration.
func RunUserDetail ¶
RunUserDetail get user tail with wallet address.
func RunUserForgotPassword ¶
RunUserForgotPassword send request to request new password.
func RunUserLogin ¶
RunUserLogin login user by email and password.
func RunUserTokenRefresh ¶
RunUserTokenRefresh refresh token with new one.
func RunWalletDeletekey ¶
RunWalletDeletekey delete wallet key.
func RunWalletDepositHistory ¶
RunWalletDepositHistory return deposit history for certain period.
func RunWalletGenAddress ¶
RunWalletGenAddress generate wallet key for deposit/withdraw.
func RunWalletGenkey ¶
RunWalletGenkey generate wallet key.
func RunWalletGetbalance ¶
RunWalletGetbalance get balance from chain.
func RunWalletImportkey ¶
RunWalletImportkey import wallet key.
func RunWalletKeylist ¶
RunWalletKeylist list key in $HOME/.ankr
func RunWalletSearchDeposit ¶
RunWalletSearchDeposit search deposit for certain period.
func RunWalletSendCoins ¶
RunWalletSendtoken send token to other wallet address.
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 ¶
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 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 ¶
AddCommand adds child commands and adds child commands for cobra as well.
func (*Command) ChildCommands ¶
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"` }