utils

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Float32ToFloat64

func Float32ToFloat64(src []float32) []float64

func Float64ToFloat32

func Float64ToFloat32(src []float64) []float32

func GetULID

func GetULID() string

func GetUUIDNoDash

func GetUUIDNoDash() string

func ParseJSONStringArray

func ParseJSONStringArray(jsonStr string) []string

ParseJSONStringArray 解析JSON字符串为字符串切片

func PtrToValue

func PtrToValue[T ToPtr](ptr *T) T

func StringToVector

func StringToVector(vectorStr string) ([]float32, error)

StringToVector 将PostgreSQL向量字符串转换为float32向量

func ToJSONString

func ToJSONString(slice []string) string

ToJSONString 将字符串切片序列化为JSON字符串

func ValueToPtr

func ValueToPtr[T ToPtr](f T) *T

func Vector64ToString

func Vector64ToString(vector []float64) string

func VectorToString

func VectorToString(vector []float32) string

VectorToString 将float32向量转换为PostgreSQL向量字符串格式

Types

type ToPtr

type ToPtr interface {
	~int | ~int8 | ~int16 | ~int32 | ~int64 |
		~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 |
		~uintptr |
		~float32 | ~float64 |
		~string |
		~bool
}

Jump to

Keyboard shortcuts

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