Documentation
¶
Index ¶
- func Byte32ToBigInt(bytes [32]byte) *big.Int
- func Byte32ToString(bytes [32]byte) string
- func ComposeDecodeHookFunc(fs ...mapstructure.DecodeHookFunc) mapstructure.DecodeHookFunc
- func DivideToFloat(x, y *big.Int) float64
- func FetchSelfPublicIP() (string, error)
- func IsIgnoreException(err error) bool
- func LoadJSONFile(path string, data any) error
- func MustItfToJSONStr(v any) string
- func MustItfToJSONStrIndex(v any) string
- func PathExists(path string) (bool, error)
- func StrToByte32(s string) ([32]byte, error)
- func StringToAddressHookFunc() mapstructure.DecodeHookFunc
- func StringToBigIntHookFunc() mapstructure.DecodeHookFunc
- func StringToDecimalHookFunc() mapstructure.DecodeHookFunc
- type IgnoreException
- type UserPrompter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Byte32ToBigInt ¶
func Byte32ToString ¶
func ComposeDecodeHookFunc ¶
func ComposeDecodeHookFunc(fs ...mapstructure.DecodeHookFunc) mapstructure.DecodeHookFunc
func DivideToFloat ¶
func FetchSelfPublicIP ¶
func IsIgnoreException ¶
func LoadJSONFile ¶
func MustItfToJSONStr ¶
func MustItfToJSONStrIndex ¶
func PathExists ¶
func StrToByte32 ¶
func StringToAddressHookFunc ¶
func StringToAddressHookFunc() mapstructure.DecodeHookFunc
func StringToBigIntHookFunc ¶
func StringToBigIntHookFunc() mapstructure.DecodeHookFunc
func StringToDecimalHookFunc ¶
func StringToDecimalHookFunc() mapstructure.DecodeHookFunc
Types ¶
type IgnoreException ¶
type IgnoreException struct {
// contains filtered or unexported fields
}
func NewIgnoreException ¶
func NewIgnoreException(err error) IgnoreException
func (IgnoreException) Error ¶
func (e IgnoreException) Error() string
type UserPrompter ¶
type UserPrompter interface { // PromptInput displays the given prompt to the user and requests some textual // data to be entered, returning the input of the user. PromptInput(prompt string) (string, error) // PromptPassword displays the given prompt to the user and requests some textual // data to be entered, but one which must not be echoed out into the terminal. // The method returns the input provided by the user. PromptPassword(prompt string) (string, error) // PromptConfirm displays the given prompt to the user and requests a boolean // choice to be made, returning that choice. PromptConfirm(prompt string) (bool, error) // SetHistory sets the input scrollback history that the prompter will allow // the user to scroll back to. SetHistory(history []string) // AppendHistory appends an entry to the scrollback history. It should be called // if and only if the prompt to append was a valid command. AppendHistory(command string) // ClearHistory clears the entire history ClearHistory() // SetWordCompleter sets the completion function that the prompter will call to // fetch completion candidates when the user presses tab. SetWordCompleter(completer liner.WordCompleter) }
UserPrompter defines the methods needed by the console to prompt the user for various types of inputs.
func NewTerminalPrompter ¶
func NewTerminalPrompter() UserPrompter
NewTerminalPrompter creates a liner based user input prompter working off the standard input and output streams.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.