utils

package
v0.0.0-...-123eced Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2025 License: MIT Imports: 14 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Base64EncodeFormByte

func Base64EncodeFormByte(bin []byte) []byte

func Base64EncodeUrlSafe

func Base64EncodeUrlSafe(bin []byte) string

func EachMapSort

func EachMapSort(eachMap interface{}, eachFunc interface{}) error

func GetInterfaceFiledValue

func GetInterfaceFiledValue(v interface{}, fieldName string) reflect.Value

func GetSelfIps

func GetSelfIps() map[string]map[string]string

func GetSelfPath

func GetSelfPath() string

func GetSelfPathFull

func GetSelfPathFull() string

func GetSelfV4IFaceFirst

func GetSelfV4IFaceFirst() string

func GetSelfV4IpFirst

func GetSelfV4IpFirst(iFace ...string) string

func GetSelfV4Ips

func GetSelfV4Ips() map[string]string

func GetSelfV6IFaceFirst

func GetSelfV6IFaceFirst() string

func GetSelfV6IpFirst

func GetSelfV6IpFirst(iFace ...string) string

func GetSelfV6Ips

func GetSelfV6Ips() map[string]string

func InterfaceToStruct

func InterfaceToStruct(out interface{}, in interface{}) error

func MakeInstanceFromSlice

func MakeInstanceFromSlice(v interface{}) (i interface{}, err error)

func MapFind

func MapFind[M ~map[K]E, K string | int | int8 | int16 | int32 | int64 | uint | uint8 | uint16 | uint32 | uint64 | float32 | float64, E any](m M, f func(E, K) bool) (e E, k K)

func MapStringValues

func MapStringValues(m map[string]string) (v []string)

func ReTry

func ReTry(callback func() bool, times int, step time.Duration)

func ReverseBits

func ReverseBits(b byte) byte

func RunningOs

func RunningOs(osName ...string) string

func SliceContains

func SliceContains[S ~[]E, E any](s S, e E) bool

func SliceFilter

func SliceFilter[S ~[]E, E any](s S, f func(E) bool) (s1 S)

func SliceFind

func SliceFind[S ~[]E, E any](s S, f func(E) bool) (e E)

func SlicePop

func SlicePop[S ~*[]E, E any](s S) (e E)

func SliceShift

func SliceShift[S ~*[]E, E any](s S) (e E)

Types

This section is empty.

Jump to

Keyboard shortcuts

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