Documentation ¶
Index ¶
- func ChecksumEthereumAddress(addr string) string
- func ConnectArray(strList []string, connector string) string
- func ContainAnyOfStrs(longStr string, targets []string) bool
- func ContainInArray[T comparable](target T, targetArray []T) bool
- func ContainPhoneticSymbol(longStr string, target string) bool
- func CreateKey() (privateKey string, address string)
- func FindBytesBetween(fullBytes []byte, bytesBefore []byte, bytesAfter []byte) (target [][]byte)
- func FindStringBetween(fullStr string, strBefore string, strAfter string) (target []string)
- 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 PhoneticSymbolToCommonLetter(str string) string
- func PrettifyJson(raw string) string
- func PrettyJsonPrintln(obj any)
- func ReadCsv(filePath string) ([][]string, error)
- func ReadJsonSlice(path string) ([]string, error)
- func RemoveFromArray[T comparable](targetArray []T, targetRem T) []T
- func RemoveFromString(targetStr string, targetRem string) string
- func RemoveRepetitionInArray[T comparable](targetArray []T) []T
- func Restart(functionToRecover func(), functionName string)
- func RestartAndSleep(functionToRecover func(), functionName string, sleepTime time.Duration)
- func SendMail(senderInfo EmailSenderStruct, receivers []string, subject string, body string) (err error)
- func SeperateIntoArray(targetStr string, seperateBy string) (res []string)
- 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 ToCommonLetter(str string) string
- func WriteNewCsv(filePath string, title []string, text [][]string) error
- func WriteToCsv(filePath string, title []string, text []string) error
- type EmailSenderStruct
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 ContainAnyOfStrs ¶ added in v0.1.1
func ContainInArray ¶
func ContainInArray[T comparable](target T, targetArray []T) bool
func ContainPhoneticSymbol ¶ added in v0.1.2
func FindBytesBetween ¶ added in v0.1.1
find all []byte between "bytesBefore" and "bytesAfter"
func FindStringBetween ¶ added in v0.1.1
find all string between "strBefore" and "strAfter"
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 ¶
For example: "TraderJoeSupplyEvent(address,address,uint256,address)". Space must not be included.
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 PhoneticSymbolToCommonLetter ¶ added in v0.1.2
func PrettifyJson ¶
func PrettyJsonPrintln ¶
func PrettyJsonPrintln(obj any)
func ReadJsonSlice ¶
func RemoveFromArray ¶ added in v0.1.1
func RemoveFromArray[T comparable](targetArray []T, targetRem T) []T
func RemoveFromString ¶ added in v0.1.1
func RemoveRepetitionInArray ¶
func RemoveRepetitionInArray[T comparable](targetArray []T) []T
func Restart ¶
func Restart(functionToRecover func(), functionName string)
Recover from panic and restart.
func RestartAndSleep ¶ added in v0.0.3
Recover from panic and restart after waiting for a while.
func SendMail ¶ added in v0.0.2
func SendMail(senderInfo EmailSenderStruct, receivers []string, subject string, body string) (err error)
func SeperateIntoArray ¶ added in v0.1.1
Seperate a string into an array, the seperater will be deleted.
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 ToCommonLetter ¶ added in v0.1.1
func WriteNewCsv ¶
If file exist, will cover the old file.