utils

package
v2.3.1 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2025 License: AGPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeBytes

func DecodeBytes(data []byte) string

DecodeBytes decode bytes

func ExchangeMarkDownImageUrl

func ExchangeMarkDownImageUrl(
	ctx context.Context,
	mdContent []byte,
	getUrl func(ctx context.Context, originUrl *string) (string, error),
) (string, error)

func GetHeaderMap

func GetHeaderMap(header string) map[string]string

GetHeaderMap get header map

func GetHttpClientWithAPIHeaderMap

func GetHttpClientWithAPIHeaderMap(header string) *http.Client

func GetQuery

func GetQuery(req *domain.ModelListReq) (request.Query, error)

func GetTitleFromMarkdown

func GetTitleFromMarkdown(markdown string) string

func HTTPGet

func HTTPGet(url string) ([]byte, error)

HTTPGet send http get request

func IsURLValid

func IsURLValid(urlStr string) bool

IsURLValid check if url is valid

func RemoveFirstDir

func RemoveFirstDir(path string) string

func RemoveURLParams

func RemoveURLParams(rawURL string) (string, error)

RemoveURLParams 去除 URL 中的查询参数

func URLNormalize

func URLNormalize(urlStr string) string

URLNormalize normalize url

func URLRemovePath

func URLRemovePath(rawURL string) (string, error)

func UrlEncode

func UrlEncode(s string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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