Documentation ¶
Overview ¶
Copyright (C) 2022, Ava Labs, Inc. All rights reserved. See the file LICENSE for licensing terms.
Copyright (C) 2022, Ava Labs, Inc. All rights reserved. See the file LICENSE for licensing terms.
Index ¶
- Constants
- func CaptureListDecision[T comparable](prompter Prompter, prompt string, capture func(prompt string) (T, error), ...) ([]T, bool, error)
- func CheckSubnetAuthKeys(subnetAuthKeys []string, controlKeys []string, threshold uint32) error
- func GetFujiKeyOrLedger(prompt Prompter, keyDir string) (bool, string, error)
- func GetSubnetAuthKeys(prompt Prompter, controlKeys []string, threshold uint32) ([]string, error)
- type Prompter
Constants ¶
const ( Yes = "Yes" No = "No" Add = "Add" Del = "Delete" Preview = "Preview" MoreInfo = "More Info" Done = "Done" Cancel = "Cancel" )
Variables ¶
This section is empty.
Functions ¶
func CaptureListDecision ¶
func CaptureListDecision[T comparable]( prompter Prompter, prompt string, capture func(prompt string) (T, error), capturePrompt string, label string, info string, ) ([]T, bool, error)
CaptureListDecision runs a for loop and continuously asks the user for a specific input (currently only `CapturePChainAddress` and `CaptureAddress` is supported) until the user cancels or chooses `Done`. It does also offer an optional `info` to print (if provided) and a preview. Items can also be removed.
func CheckSubnetAuthKeys ¶
check subnet authorization criteria: - [subnetAuthKeys] satisfy subnet's [threshold] - [subnetAuthKeys] is a subset of subnet's [controlKeys]
func GetFujiKeyOrLedger ¶
Types ¶
type Prompter ¶
type Prompter interface { CapturePositiveBigInt(promptStr string) (*big.Int, error) CaptureAddress(promptStr string) (common.Address, error) CaptureNewFilepath(promptStr string) (string, error) CaptureExistingFilepath(promptStr string) (string, error) CaptureYesNo(promptStr string) (bool, error) CaptureNoYes(promptStr string) (bool, error) CaptureList(promptStr string, options []string) (string, error) CaptureString(promptStr string) (string, error) CaptureGitURL(promptStr string) (*url.URL, error) CaptureStringAllowEmpty(promptStr string) (string, error) CaptureEmail(promptStr string) (string, error) CaptureIndex(promptStr string, options []any) (int, error) CaptureVersion(promptStr string) (string, error) CaptureDuration(promptStr string) (time.Duration, error) CaptureDate(promptStr string) (time.Time, error) CaptureNodeID(promptStr string) (ids.NodeID, error) CaptureID(promptStr string) (ids.ID, error) CaptureWeight(promptStr string) (uint64, error) CaptureUint64(promptStr string) (uint64, error) CapturePChainAddress(promptStr string, network models.Network) (string, error) CaptureFutureDate(promptStr string, minDate time.Time) (time.Time, error) ChooseKeyOrLedger() (bool, error) }
func NewPrompter ¶
func NewPrompter() Prompter
NewProcessChecker creates a new process checker which can respond if the server is running