Documentation ¶
Index ¶
- func ChecksumEthereumAddress(addr string) string
- func ConnectArray(strList []string, connector string) string
- func ContainInArray[T comparable](target T, targetArray []T) bool
- func CryptoRandBelow(length int) int
- func CryptoRandBetween(start int, end int, times int) []int
- func FormatJson(obj any) string
- func FormatJsonByte(obj any) []byte
- func GetMonthStart(location string) time.Time
- func GetStringHash(input string) string
- func GetTimeByStr(str string, location string) time.Time
- func GetTimeRangeByType(t string, location string) (start int64, end int64)
- func GetTodayStart(location string) time.Time
- func GetWeekStart(location string) time.Time
- func GetYearStart(location string) time.Time
- func MathRandBelow(length int) int
- func Max[T OrderedNumber](x, y T) T
- func Min[T OrderedNumber](x, y T) T
- func PrettifyJson(raw string) string
- func PrettyJsonPrintln(obj any)
- func ReadCsv(filePath string) ([][]string, error)
- func ReadJsonSlice(path string) ([]string, error)
- func RemoveRepetitionInArray[T comparable](targetArray []T) []T
- func Restart(functionToRecover func(), functionName string)
- func SendTelegram(botToken string, chatId int64, text ...any) error
- func SimpleMarshal(obj any) []byte
- func SimpleStringify(obj any) string
- func Stringify(obj any) string
- func TimeFormat(timestamp int64, location string) string
- func TimeFormatTime(timestamp int64, location string) time.Time
- func TimeNowString() string
- func TimestampNow() int
- func ToAddress(input any) common_eth.Address
- func ToBigInt(input any) *big.Int
- func ToDecimal(input any) decimal.Decimal
- func ToFloat64(input any) float64
- func ToInt(input any) int
- func ToInt64(input any) int64
- func ToLowerString(input any) string
- func ToString(input any) string
- func WriteNewCsv(filePath string, title []string, text [][]string) error
- func WriteToCsv(filePath string, title []string, text []string) error
- type AddressTypes
- type BigNumber
- type Float
- type Integer
- type Number
- type Ordered
- type OrderedNumber
- type RobotAdapter
- type Signed
- type Unsigned
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChecksumEthereumAddress ¶
return checksummed ethereum address
func ConnectArray ¶
connect the items in an array with "connector"
func ContainInArray ¶
func ContainInArray[T comparable](target T, targetArray []T) bool
func CryptoRandBetween ¶
choose "times" different numbers between "start" and "end"
func FormatJson ¶
func FormatJsonByte ¶
func GetMonthStart ¶
if location is "" or "UTC", use UTC time if location is "Local", use local time location can also be "America/New_York", "Asia/Shanghai", etc
func GetStringHash ¶
func GetTimeByStr ¶
if location is "" or "UTC", use UTC time if location is "Local", use local time location can also be "America/New_York", "Asia/Shanghai", etc
func GetTimeRangeByType ¶
if location is "" or "UTC", use UTC time if location is "Local", use local time location can also be "America/New_York", "Asia/Shanghai", etc
func GetTodayStart ¶
if location is "" or "UTC", use UTC time if location is "Local", use local time location can also be "America/New_York", "Asia/Shanghai", etc
func GetWeekStart ¶
if location is "" or "UTC", use UTC time if location is "Local", use local time location can also be "America/New_York", "Asia/Shanghai", etc
func GetYearStart ¶
if location is "" or "UTC", use UTC time if location is "Local", use local time location can also be "America/New_York", "Asia/Shanghai", etc
func Max ¶
func Max[T OrderedNumber](x, y T) T
func Min ¶
func Min[T OrderedNumber](x, y T) T
func PrettifyJson ¶
func PrettyJsonPrintln ¶
func PrettyJsonPrintln(obj any)
func ReadJsonSlice ¶
func RemoveRepetitionInArray ¶
func RemoveRepetitionInArray[T comparable](targetArray []T) []T
func Restart ¶
func Restart(functionToRecover func(), functionName string)
recover from panic and wait for a while
func SimpleMarshal ¶
func SimpleStringify ¶
func TimeFormat ¶
if location is "" or "UTC", use UTC time if location is "Local", use local time location can also be "America/New_York", "Asia/Shanghai", etc
func TimeFormatTime ¶
if location is "" or "UTC", use UTC time if location is "Local", use local time location can also be "America/New_York", "Asia/Shanghai", etc
func TimeNowString ¶
func TimeNowString() string
func TimestampNow ¶
func TimestampNow() int
func ToAddress ¶
func ToAddress(input any) common_eth.Address
func ToLowerString ¶
func WriteNewCsv ¶
if exist, will cover the old file
Types ¶
type AddressTypes ¶
type AddressTypes interface { string | common_eth.Address }
type Number ¶
type Number interface { OrderedNumber | BigNumber }
type OrderedNumber ¶
type RobotAdapter ¶
func NewBot ¶
func NewBot(token string) (RobotAdapter, error)
func (*RobotAdapter) SendTelegram ¶
func (r *RobotAdapter) SendTelegram(chat_id int64, v ...any)
send telegram