util

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2025 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateId

func GenerateId() string

func GetAudioDuration added in v0.5.0

func GetAudioDuration(filePath string) (time.Duration, error)

func GetLocalIp added in v0.2.0

func GetLocalIp() string

func HttpPost

func HttpPost(ctx context.Context, url string, header map[string]string, data, result interface{}, proxyURL string) error

func Round added in v0.5.0

func Round(f float64, n int) float64

func SSEServer

func SSEServer(ctx context.Context, data string) error

func ToMap

func ToMap[T any, K int | string](arr []T, fn func(T) K) map[K]T

切片转 Map

func Unique

func Unique[T IntInterface | string](data []T) []T

切片去重

Types

type IntInterface

type IntInterface interface {
	uint | uint8 | uint16 | uint32 | uint64 | int | int8 | int16 | int32 | int64
}

Jump to

Keyboard shortcuts

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