utils

package
v0.23.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AcceptTermsInteractive

func AcceptTermsInteractive() bool

func BoolToInt

func BoolToInt(b bool) int

func CreateJwtSecret

func CreateJwtSecret(dest string) error

func EthEpochToTimestamp added in v0.21.0

func EthEpochToTimestamp(ethEpoch, epochZeroTimestamp uint64) (t time.Time, isValid bool)

EthEpochToTimestamp converts given Ethereum Epoch to a timestamp of its occurence, assuming the chain started at given epochZeroTimestamp (in unix epoch format). It returns the converted time and bool, which is false when the time is invalid or too large.

func Exit

func Exit(message string, exitCode int) error

func FileExists

func FileExists(path string) bool

func FlagFileExists

func FlagFileExists(ctx *cli.Context, flag string) bool

FlagFileExists check whether a path under given flag exists

func GetLastFile

func GetLastFile(dir string, dependency string) (string, error)

GetLastFile returns name of last file from given directory in alphabetical order. In case of log files last one is also the newest (format increments similar to typical number - YYYY-MM-DD_HH:MM:SS)

func MaxLength added in v0.22.0

func MaxLength(strs []string) (length int)

MaxLength returns the length of the longest string - used for creating padding from a given client set.

func PrepareTimestampedFile

func PrepareTimestampedFile(logDir, logFileName string) (logFile string, err error)

func ReadValidatorPassword

func ReadValidatorPassword(ctx *cli.Context) (f *os.File, err error)

ReadValidatorPassword is responsible for creating a secure way to pass a validator password from lukso CLI to a client of user's choosing

func RegisterInputWithMessage

func RegisterInputWithMessage(message string) (input string)

func TruncateFileFromDir

func TruncateFileFromDir(filePath string) string

TruncateFileFromDir removes file name from its path. Example: /path/to/foo/foo.txt => /path/to/foo

Types

This section is empty.

Jump to

Keyboard shortcuts

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