ui

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Copyright 2022 Nethermind

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidEthereumAddress = errors.New("invalid ethereum address")
	ErrInvalidInt64String     = errors.New("invalid int64 string")
	ErrInvalidFileExtension   = errors.New("invalid file extension")
	ErrInvalidURL             = errors.New("invalid URL")
	ErrInvalidDigitString     = errors.New("invalid number")
)

Functions

func DigitsStringValidator added in v1.0.0

func DigitsStringValidator(ttd string) error

DigitsStringValidator validates that the input is a valid string with only digits

func DirPathValidator added in v1.0.0

func DirPathValidator(ans string) error

func EthAddressValidator added in v1.0.0

func EthAddressValidator(address string, allowEmpty bool) error

func FilePathValidator added in v1.0.0

func FilePathValidator(ans interface{}) error

func GraffitiValidator added in v1.0.0

func GraffitiValidator(str string) error

func Int64Validator added in v1.0.0

func Int64Validator(ans interface{}) error

func PrintFileContent added in v0.3.0

func PrintFileContent(w io.Writer, path string) error

PrintFileContent This functions outputs the contents of a file to a writer

params :- a. w io.Writer Writer to be use for writing the file content b. path string Path to the file to write its content

returns :- a. error Error if any

func URLValidator added in v1.0.0

func URLValidator(ans interface{}) error

func WriteListClientsTable

func WriteListClientsTable(w io.Writer, data *ListClientsTable)

WriteListClientsTable : Prints the supported clients table

params :- a. w io.Writer Where the table is to be printed b. data ListClientsTable Table data

returns :- None

func WriteListNetworksTable

func WriteListNetworksTable(w io.Writer, data []string)

WriteListNetworksTable : Prints the supported networks table

params :- a. w io.Writer Where the table is to be printed b. data []string Table data

returns :- None

func WriteRandomizedClientsTable

func WriteRandomizedClientsTable(w io.Writer, data RandomizedClientsTable)

WriteRandomizedClientsTable : Prints the randomized clients table

params :- a. w io.Writer Where the table is to be printed b. data [][]string Table data

returns :- None

func WriteSimpleTable

func WriteSimpleTable(w io.Writer, data *SimpleTableData)

WriteSimpleTable : Prints a simple table from given data

params :- a. w io.Writer Where the table is to be printed b. data SimpleTableData Table data

returns :- None

Types

type ListClientsTable

type ListClientsTable struct {
	ClientTypes []string
	Clients     [][]string
}

type Prompter added in v1.0.0

type Prompter interface {
	Select(message string, defaultValue string, options []string) (int, error)
	Confirm(string, bool) (bool, error)
	Input(prompt, defaultValue string, required bool, validator func(string) error) (result string, err error)
	InputInt64(prompt string, defaultValue int64) (result int64, err error)
	InputFilePath(prompt, defaultValue string, required bool, fileExtensions ...string) (result string, err error)
	InputDirPath(prompt, defaultValue string, required bool) (result string, err error)
	InputURL(prompt, defaultValue string, required bool) (result string, err error)
	InputSecret(prompt string) (result string, err error)
	EthAddress(prompt string, defaultValue string, required bool) (result string, err error)
	InputList(prompt string, defaultValue []string, validator func([]string) error) (result []string, err error)
}

func NewPrompter added in v1.0.0

func NewPrompter() Prompter

type RandomizedClientsTable

type RandomizedClientsTable struct {
	ClientTypes []string
	Clients     []string
}

type SimpleTableData

type SimpleTableData struct {
	Headers      []*simpletable.Cell
	Columns      [][]*simpletable.Cell
	DefaultAlign int
	Enumerate    bool
}

Jump to

Keyboard shortcuts

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