Documentation
¶
Index ¶
- Constants
- Variables
- func CleanString(input string) string
- func DefaultCoinDenomRegex() string
- func IsValidTimestamp(s string) error
- func NoOps(_ string) error
- func SetCoinDenomRegex(reFn func() string)
- func TransformFirstWordLowerCase(input string) string
- func TransformFirstWordUpperCase(input string) string
- func ValidateAddress(s string) error
- func ValidateAddresses(s string) error
- func ValidateAddressesOrHexAddresses(s string) error
- func ValidateAnyHexAddressOrAddress(s string) error
- func ValidateDNS(dns string) bool
- func ValidateDecCoin(coinStr string) (err error)
- func ValidateDecFromStr(str string) error
- func ValidateDenom(denom string) error
- func ValidateDenomWithReserved(reservedDenoms []string) func(denom string) error
- func ValidateEmptyString(s string) error
- func ValidateExactString(expect string) func(s string) error
- func ValidateInteger(s string) error
- func ValidateMnemonic(mnemonic string) error
- func ValidateNonEmptyAndLengthString(display string, maxLen int) func(s string) error
- func ValidatePeerOrSeed(addresses string) error
- func ValidatePositiveBigInt(s string) error
- func ValidatePositiveBigIntOrZero(s string) error
- func ValidateTarLz4Header(dest string) error
- func ValidateURL(str string) error
- func ValidateURLWithPort(str string) error
- func ValidateUint64(s string) error
- func ValidateWSURL(str string) error
- func WrapText(text string) string
- func WrapTextWithLimit(text string, limit int) string
Constants ¶
const ( WeaveDirectory = ".weave" WeaveConfigFile = WeaveDirectory + "/config.json" WeaveDataDirectory = WeaveDirectory + "/data" WeaveLogDirectory = WeaveDirectory + "/log" SnapshotFilename = "snapshot.weave" InitiaDirectory = ".initia" InitiaConfigDirectory = "/config" InitiaDataDirectory = "/data" WeaveGasStationKeyName = "weave.GasStation" MinitiaDirectory = ".minitia" MinitiaConfigPath = ".minitia/config" MinitiaArtifactsConfigJson = "/artifacts/config.json" MinitiaArtifactsJson = "/artifacts/artifacts.json" OPinitDirectory = ".opinit" OPinitAppName = "opinitd" OPinitKeyFileJson = "/weave.keyfile.json" OpinitGeneratedKeyFilename = "weave.opinit.generated" RelayerDirectory = ".relayer" RelayerConfigPath = ".relayer/config.json" RollyticsDirectory = ".rollytics" RollyticsConfigPath = ".rollytics/.env" )
const (
DefaultTerminalWidth = 80
)
Variables ¶
var ( MaxBitLen = 256 // LegacyPrecision number of decimal places LegacyPrecision = 18 // LegacyDecimalPrecisionBits bits required to represent the above precision // Ceiling[Log2[10^Precision - 1]] LegacyDecimalPrecisionBits = 60 ErrLegacyEmptyDecimalStr = errors.New("decimal string cannot be empty") ErrLegacyInvalidDecimalLength = errors.New("invalid decimal length") ErrLegacyInvalidDecimalStr = errors.New("invalid decimal string") )
Functions ¶
func CleanString ¶
CleanString utility function to clean the string by trimming spaces and removing ^M characters
func DefaultCoinDenomRegex ¶
func DefaultCoinDenomRegex() string
DefaultCoinDenomRegex returns the default regex string
func IsValidTimestamp ¶
func SetCoinDenomRegex ¶
func SetCoinDenomRegex(reFn func() string)
SetCoinDenomRegex allows for coin's custom validation by overriding the regular expression string used for denom validation.
func ValidateAddress ¶ added in v0.3.1
func ValidateAddresses ¶ added in v0.3.1
func ValidateAddressesOrHexAddresses ¶ added in v0.3.1
func ValidateAnyHexAddressOrAddress ¶ added in v0.3.1
func ValidateDNS ¶ added in v0.3.1
IsValidDNS checks if a given string is a valid DNS name
func ValidateDecCoin ¶
func ValidateDecFromStr ¶
func ValidateDenom ¶
ValidateDenom is the default validation function for Coin.Denom.
func ValidateDenomWithReserved ¶ added in v0.1.2
func ValidateEmptyString ¶
func ValidateExactString ¶
func ValidateInteger ¶ added in v0.3.1
func ValidateMnemonic ¶
func ValidatePeerOrSeed ¶ added in v0.3.1
ValidatePeerOrSeed checks if each address in a comma-separated list is valid. It allows empty strings and returns an error with detailed reasons if any address is invalid. It accepts both IP addresses and DNS names.
func ValidatePositiveBigInt ¶ added in v0.1.3
func ValidatePositiveBigIntOrZero ¶ added in v0.1.3
func ValidateTarLz4Header ¶
ValidateTarLz4Header checks if the downloaded file is a valid .tar.lz4 file based on the file header.
func ValidateURL ¶
ValidateURL is a function to validate if a string is a valid URL and return an error if invalid. Only http and https schemes are allowed.
func ValidateURLWithPort ¶ added in v0.1.6
ValidateURLWithPort is a function to validate if a string is a valid URL with a port number. Only http and https schemes are allowed, and the URL must include a valid port.
func ValidateUint64 ¶ added in v0.1.5
func ValidateWSURL ¶
ValidateWSURL is a function to validate if a string is a valid WebSocket URL and return an error if invalid. Only ws and wss schemes are allowed.
func WrapTextWithLimit ¶
Types ¶
This section is empty.