icutils

package
v1.3.5 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SchemePattern   = `(http:\/\/|https:\/\/)`
	HostNamePattern = `(localhost|(?:[\w\d](?:[\w\d-]{0,61}[\w\d])\.)+[\w\d][\w\d-]{0,61}[\w\d])`
	IPv4Pattern     = `(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])`
	PortPattern     = `(:[0-9]{1,5})?`
	PathPattern     = `(\/\S*)?`
	EmailPattern    = `[a-zA-Z0-9]+(\.[a-zA-Z0-9]+)*@` + HostNamePattern

	PortMax       = 65536
	EmailLocalMax = 64
	EmailMax      = 254
)

Variables

View Source
var BigIntICX = big.NewInt(1_000_000_000_000_000_000)

Functions

func BigInt2HexInt

func BigInt2HexInt(value *big.Int) *common.HexInt

func ICXToIScore added in v0.9.8

func ICXToIScore(icx *big.Int) *big.Int

func IScoreToICX added in v0.9.8

func IScoreToICX(iScore *big.Int) *big.Int

func IsNil added in v1.1.0

func IsNil(i interface{}) bool

func MergeMaps

func MergeMaps(maps ...map[string]interface{}) map[string]interface{}

func Min

func Min(value1, value2 int) int

func NewIconLogger

func NewIconLogger(logger log.Logger) log.Logger

func Pow10

func Pow10(n int) *big.Int

func ToDecimal

func ToDecimal(x, y int) *big.Int

func ToKey

func ToKey(o interface{}) string

func ToLoop

func ToLoop(icx int) *big.Int

func ValidateCountryAlpha3 added in v0.9.8

func ValidateCountryAlpha3(alpha3 string) error

func ValidateEmail

func ValidateEmail(email string, revision int) error

func ValidateEndpoint

func ValidateEndpoint(endpoint string) error

func ValidateRange

func ValidateRange(oldValue *big.Int, newValue *big.Int, minPct int, maxPct int) error

func ValidateURL

func ValidateURL(url string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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