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.
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.
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.
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.
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.
Index ¶
- Variables
- func DigitsStringValidator(ttd string) error
- func DirPathValidator(ans string) error
- func EthAddressValidator(address string, allowEmpty bool) error
- func FilePathValidator(ans interface{}) error
- func GraffitiValidator(str string) error
- func Int64Validator(ans interface{}) error
- func PrintFileContent(w io.Writer, path string) error
- func URLValidator(ans interface{}) error
- func WriteListClientsTable(w io.Writer, data *ListClientsTable)
- func WriteListNetworksTable(w io.Writer, data []string)
- func WriteRandomizedClientsTable(w io.Writer, data RandomizedClientsTable)
- func WriteSimpleTable(w io.Writer, data *SimpleTableData)
- type ListClientsTable
- type Prompter
- type RandomizedClientsTable
- type SimpleTableData
Constants ¶
This section is empty.
Variables ¶
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 ¶
DigitsStringValidator validates that the input is a valid string with only digits
func DirPathValidator ¶
func EthAddressValidator ¶
func FilePathValidator ¶
func FilePathValidator(ans interface{}) error
func GraffitiValidator ¶
func Int64Validator ¶
func Int64Validator(ans interface{}) error
func PrintFileContent ¶
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 ¶
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 ¶
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 Prompter ¶
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 ¶
func NewPrompter() Prompter
type RandomizedClientsTable ¶
type SimpleTableData ¶
type SimpleTableData struct { Headers []*simpletable.Cell Columns [][]*simpletable.Cell DefaultAlign int Enumerate bool }