util

package
v0.0.0-...-80b22ab Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2021 License: AGPL-3.0 Imports: 9 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncodeInt

func EncodeInt(val interface{}) []byte

EncodeInt encodes an integer to a byte array

func GetEnvelopeName

func GetEnvelopeName(raw string) string

GetEnvelopeName translates a raw envelope type to a name

func GetProcessName

func GetProcessName(raw string) string

GetProcessName translates a raw process type to a name

func GetTransactionName

func GetTransactionName(raw string) string

GetTransactionName translates a raw transaction type to a name

func GetTransactionType

func GetTransactionType(raw *models.Tx) string

GetTransactionType translates a raw transaction to a type string

func HexToString

func HexToString(bytes []byte) string

HexToString converts an array of hexbytes to a string

func IntToString

func IntToString(val interface{}) string

IntToString takes an int32, int64, or int, and returns a string

func Max

func Max(a, b int) int

Max returns the max of two ints

func Min

func Min(a, b int) int

Min returns the min of two ints

func MsToSecondsString

func MsToSecondsString(ms int32) string

MsToSecondsString only returns the second part of a ms unit, as a string

func MsToString

func MsToString(ms int32) string

MsToString turns a milliseconds int32 to a readable string

func SearchSlice

func SearchSlice(source []string, search string) []string

SearchSlice searches a slice of strings and returns all strings who have substrings matching the search term

func StringInSlice

func StringInSlice(a string, list []string) bool

StringInSlice returns true if given string is in the list of strings

func TrimHex

func TrimHex(str string) string

TrimHex removes the hex prefix from a string

func TrimSlice

func TrimSlice(slice []string, lim int, page *int) []string

TrimSlice trims a slice of strings to lim elements. If rev is set to true, trims from beginning rather than end.

Types

This section is empty.

Jump to

Keyboard shortcuts

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