param

package
v1.2.1-rc3 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package param provide some util for param parse

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureBool

func EnsureBool(p any, defaultVal bool) bool

EnsureBool 判断给定的p是否可表示为合法Bool类型,否则返回defaultVal

支持的合法类型有

type bool

type gjson.True or gjson.False

type string "true","yes","1" or "false","no","0" (case insensitive)

func SplitURL

func SplitURL(s string) []string

SplitURL 将给定URL字符串分割为两部分,用于URL预处理防止风控

Types

This section is empty.

Jump to

Keyboard shortcuts

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