Documentation ¶
Index ¶
- Constants
- func ConvertAddressArrayPrefixes(addrs []string, prefixes []string) []string
- func ConvertAddressPrefix(addr, prefix string) (string, error)
- func ConvertAddressPrefixes(addr string, prefixes []string) []string
- func Env(key, defaultValue string) string
- func EnvInt(key string, defaultValue int) int
- func GetEventStrings(events types.StringEvents) []string
- func GetEventValue(event *types.StringEvent, key string) string
- func GetEventsValue(events types.StringEvents, t string, key string) string
- func ParseCoinFromEventString(coinStr string) (uint64, error)
- func ParseEvents(query []string) (events types.StringEvents, err error)
- func ParseKeywords(keyword string) []string
- func SanitizeJSON(bz []byte) []byte
- type RawIncome
Constants ¶
View Source
const ( SANITIZER_OK = iota SANITIZER_BAD )
Variables ¶
This section is empty.
Functions ¶
func ConvertAddressArrayPrefixes ¶
basically it's `addrs.flatMap((addr) => ConvertAddressPrefixes(addr, prefixes))`
func ConvertAddressPrefix ¶
func ConvertAddressPrefixes ¶
func GetEventStrings ¶
func GetEventStrings(events types.StringEvents) []string
func GetEventValue ¶
func GetEventValue(event *types.StringEvent, key string) string
func GetEventsValue ¶
func GetEventsValue(events types.StringEvents, t string, key string) string
func ParseEvents ¶
func ParseEvents(query []string) (events types.StringEvents, err error)
func ParseKeywords ¶
func SanitizeJSON ¶
Need to remove \u0000 and Unicode surrogate pairs. \u0000 is not allowed in Postgres. JSON may contain UTF-16 sequences that is more than 16 bits, e.g. "\uD83D\uDE02" = "😂". These pairs are called surrogate pairs. They are converted into single character in Postgres JSONB storage. So Postgres don't accept one single dangling surrogate code point (they are actually invalid). But somehow these invalid code points appear in JSON...
Types ¶
Click to show internal directories.
Click to hide internal directories.