Documentation ¶
Index ¶
- func AreSortedStringArraysEquals(arr1, arr2 []string) bool
- func GetClosesRange(fromNumber, toNumber int64, excludeNumbers []int64) (hasResult bool, from, to int64)
- func GetClosesRangeWithExtensible(fromNumber, toNumber int64, ...) (hasResult bool, from, to int64, err error)
- func GetEpochWeek(optionalEpochUtcSeconds int64) int64
- func GetPartitionedTableNameByChainId(tableName, chainId string) string
- func GetPartitionedTableNameBySaltInt64AndChainId(tableName string, salt int64, chainId string) string
- func IsEvmAddress(addr string) bool
- func IsUrl(str string) bool
- func IsValidCosmosTransactionHash(hash string) bool
- func IsValidEvmTransactionHash(hash string) bool
- func MakePartitionIdFromKeys(keys ...any) string
- func MergeError(err error, errs ...error) error
- func NormalizeAddress(addr string) string
- func NormalizeChainId(chainId string) string
- func ObserveLongOperation(actionName string, action func() error, warningAfter time.Duration, ...) error
- func UnsafeExtractBech32Hrp(bech32Addr string) (hrp string, success bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetClosesRange ¶
func GetClosesRange(fromNumber, toNumber int64, excludeNumbers []int64) (hasResult bool, from, to int64)
GetClosesRange returns the closest range of numbers, that not in the-exclude list. The input number must be > 0.
func GetClosesRangeWithExtensible ¶
func GetClosesRangeWithExtensible( fromNumber, toNumber int64, funcGetExcludeNumbers func(int64, int64) ([]int64, error), onFirstTryNoResultExtendUpTo int64, onFirstTryNoResultExtendSize int, ) (hasResult bool, from, to int64, err error)
GetClosesRangeWithExtensible returns the closest range of numbers, that not in the-exclude list. The input number must be > 0. When no result, it used the provided arguments to extend the range and retry.
func GetEpochWeek ¶
func GetPartitionedTableNameByChainId ¶
GetPartitionedTableNameByChainId returns the partitioned table name of the given table for the corresponding chain id. NOTICE: the implementation have to be safe from SQL injection.
func GetPartitionedTableNameBySaltInt64AndChainId ¶
func GetPartitionedTableNameBySaltInt64AndChainId(tableName string, salt int64, chainId string) string
GetPartitionedTableNameBySaltInt64AndChainId returns the partitioned table name of the given table for the corresponding chain id with salt int64. NOTICE: the implementation have to be safe from SQL injection.
func IsEvmAddress ¶
func MakePartitionIdFromKeys ¶
MakePartitionIdFromKeys builds a partition id from the given keys.
func MergeError ¶
func NormalizeAddress ¶
func NormalizeChainId ¶
func ObserveLongOperation ¶
func ObserveLongOperation( actionName string, action func() error, warningAfter time.Duration, logger logging.Logger, ) error
ObserveLongOperation is a utility function that observes a long operation and logs a warning if it takes too long. TODO: use ObserveLongOperation when creating table partitions
func UnsafeExtractBech32Hrp ¶
Types ¶
This section is empty.