utils

package
v0.8.3 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2026 License: Apache-2.0, MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChunkSlice

func ChunkSlice[T any](slice []T, chunkSize int) [][]T

ChunkSlice splits a slice into multiple sub-slices of the specified size

func MapSlice

func MapSlice[A any, B any](in []A, f func(A) B) []B

MapSlice applies a function to each element of a slice and returns a new slice with the results

func Sign

func Sign(appID, apiKey, requestID, bodyJSON string) map[string]string

Sign 按 WeKnoraCloud 参考实现生成请求头。 appID: 上游 APPID apiKey: 上游 API Key(当前沿用 AppSecret 字段承载) requestID: 每次请求唯一的 UUID 字符串 bodyJSON: 请求体 JSON 字符串,空请求体传 "{}"

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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