Documentation ¶
Index ¶
- Constants
- Variables
- func AddHex(s string) string
- func BigIntFromInterface(i interface{}) *big.Int
- func BoolFromInterface(i interface{}) bool
- func BytesToHex(b []byte) string
- func CallerName() string
- func CamelString(s string) string
- func ContinuousSlice(start, count int, order string) (r []int)
- func DecimalFromInterface(i interface{}) decimal.Decimal
- func GetEnv(key, defaultValue string) string
- func GetFuncName() string
- func GetStringValueByFieldName(n interface{}, fieldName string) (string, bool)
- func HexToBytes(s string) []byte
- func HexToNumStr(v string) string
- func HttpGet(url string) ([]byte, error)
- func InsertInts(o []int, index int, new int) []int
- func Int64FromInterface(i interface{}) int64
- func IntFromInterface(i interface{}) int
- func IntInSlice(a int, list []int) bool
- func IntToHex(i interface{}) string
- func IntToString(i int) string
- func InterfaceToString(i interface{}) string
- func IsK8s() bool
- func IsProduction() bool
- func MapStringToSlice(m map[string]bool) []string
- func PostWithJson(data []byte, url string) ([]byte, error)
- func SetEndpointCache(endpoint string)
- func StringInSlice(a string, list []string) bool
- func StringToInt(s string) int
- func StringsExclude(a []string, b []string) []string
- func StringsIntersection(a []string, b []string) []string
- func TrimHex(s string) string
- func U256(v string) *big.Int
- func U32Encode(i int) string
- func UnmarshalToAnything(r interface{}, raw interface{})
- func UpperCamel(s string) string
- func WsEndpointCache() string
Constants ¶
View Source
const ( CrabNetwork = "darwinia-canary" KusamaNetwork = "kusama" Edgeware = "edgeware" Acala = "acala-test" Plasm = "plasm" )
Variables ¶
View Source
var ( ParamsError = ecode.New(10001) InvalidAccountAddress = ecode.New(10002) RecordNotFound = ecode.New(10004) )
View Source
var ( HostName string Environment string WSEndPoint string NetworkNode = GetEnv("NETWORK_NODE", KusamaNetwork) IsDarwinia = StringInSlice(NetworkNode, []string{CrabNetwork}) )
View Source
var ( SubPool *redis.Pool SubScanChannel = fmt.Sprintf("%s_scan", NetworkNode) PubTopicMetadata = "metadata_update" PubNewFinalized = "new_finalized" )
Functions ¶
func BigIntFromInterface ¶
func BytesToHex ¶
func ContinuousSlice ¶
func DecimalFromInterface ¶
func GetFuncName ¶
func GetFuncName() string
func HexToBytes ¶
func HexToNumStr ¶
func Int64FromInterface ¶
func Int64FromInterface(i interface{}) int64
func IntInSlice ¶
func InterfaceToString ¶
func InterfaceToString(i interface{}) string
func IsProduction ¶
func IsProduction() bool
func MapStringToSlice ¶
func SetEndpointCache ¶
func SetEndpointCache(endpoint string)
func StringInSlice ¶
func StringToInt ¶
func StringsIntersection ¶
func UnmarshalToAnything ¶
func UnmarshalToAnything(r interface{}, raw interface{})
func UpperCamel ¶
func WsEndpointCache ¶
func WsEndpointCache() string
Types ¶
This section is empty.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.