util

package
v1.0.11 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2024 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OmipSoftwareVersion = "1.0.11"
)

Variables

This section is empty.

Functions

func Assert

func Assert(value bool)

func CheckErr

func CheckErr(err error)

func CheckTimeStampIsInThisMonth

func CheckTimeStampIsInThisMonth(timestamp int64) (result bool)

func ClipboardCopy

func ClipboardCopy() string

func ClipboardPaste

func ClipboardPaste(paste string)

func ConvertDateStrToInt added in v1.0.11

func ConvertDateStrToInt(timeString string) int64

func ConvertServerTimeStrToInt

func ConvertServerTimeStrToInt(timeString string) int64

func ConvertTimeStrToInt

func ConvertTimeStrToInt(timeString string) int64

func ConvertUnixTimeToDateStr added in v1.0.11

func ConvertUnixTimeToDateStr(timeValue int64) string

func ConvertUnixTimeToStr

func ConvertUnixTimeToStr(timeValue int64) string

func CreateDirectory

func CreateDirectory(dirName string) bool

func Decrypt

func Decrypt(data []byte, passphrase string) (plaintext []byte, success bool)

func Encrypt

func Encrypt(data []byte, passphrase string) []byte

func Exists

func Exists(name string) bool

func GenSysPassphrase

func GenSysPassphrase() (result string)

func GenerateRandomBytes

func GenerateRandomBytes(n int) ([]byte, error)

func GenerateRandomString

func GenerateRandomString(n int) string

func Get32BitMd5FromString

func Get32BitMd5FromString(input string) int32

func Get64BitMd5FromString

func Get64BitMd5FromString(input string) int64

func GetAppDataDir

func GetAppDataDir() (appData string)

func GetColor

func GetColor(max float64, val float64, reverse bool) *color.NRGBA

func GetImgFromUrl

func GetImgFromUrl(srcUrl string, dstPath string)

func GetSortKeysFromFloat64Map

func GetSortKeysFromFloat64Map(x interface{}, reverse bool) []float64

func GetSortKeysFromIntMap

func GetSortKeysFromIntMap(x interface{}, reverse bool) []int

func GetSortKeysFromStrMap

func GetSortKeysFromStrMap[T any](x StringMap[T], reverse bool) []string

func GetSortKeysFromStrMap2

func GetSortKeysFromStrMap2(x interface{}, reverse bool) []string

func GetTimeDiffStringFromDiff

func GetTimeDiffStringFromDiff(timeDiff int64) string

func GetTimeDiffStringFromTS

func GetTimeDiffStringFromTS(timestamp int64) (string, bool)

func HumanizeNumber

func HumanizeNumber(input float64) string

func OpenUrl

func OpenUrl(url string)

func RemoveIdx

func RemoveIdx[T any](s []T, idx int) []T

func SendReq

func SendReq(urlStr string) (retval bool)

func TimeDiffStrStarEnd

func TimeDiffStrStarEnd(start int64, end int64) (string, bool)

func UnixTS2AdashDateTimeStr

func UnixTS2AdashDateTimeStr(ts int64) string

func UnixTS2DateStr

func UnixTS2DateStr(ts int64) string

func UnixTS2DateTimeStr

func UnixTS2DateTimeStr(ts int64) string

func UnixTS2YMStr

func UnixTS2YMStr(ts int64) string

Types

type StringMap

type StringMap[T any] map[string]T

Jump to

Keyboard shortcuts

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