Documentation
¶
Index ¶
- Constants
- func Atoi(num string, base int) int64
- func Atoid(num string) int64
- func Contains[T any](items *[]T, item T) bool
- func ContentDisposition(filename string, dispositionType ContentDispositionType) (disposition string)
- func Flat[T flatType](from T) *flatConverter[T]
- func FormatInt(num int64, base int) string
- func FormatIntd(num int64) string
- func Gid() (id uint64)
- func If[T any](condition bool, result T) (t T)
- func Ifx[T any](condition bool, first T, second T) (t T)
- func Index[T any](items *[]T, item T) (index int)
- func Set[T any](setter func(value T), first T, second T)
- func Ternary[T any](condition bool, first T, second T) (t T)
- func ToString(from any) (to string)
- func ToStrings(from ...any) (to []string)
- type CannotCompare
- type CannotCopy
- type Case
- type ContentDispositionType
- type Field
- type Fields
- type HttpMethod
- type HttpParameterType
- type Key
- type Kv
- type Object
- type Package
- type Size
- type UriScheme
- type Value
Constants ¶
View Source
const ( // CasePositionNone 无 CasePositionNone casePosition = iota // CasePositionHead 首 CasePositionHead // CasePositionTail 尾 CasePositionTail // CasePositionAll 全部 CasePositionAll )
View Source
const ( // StringEmpty 空字符串 StringEmpty = "" StringSpace = " " // Float64Size 64位长度 Float64Size = 64 )
View Source
const ( // HeaderAcceptLanguage 可接受的语言 HeaderAcceptLanguage = "Accept-Language" // HeaderContentType 请求数据类型 HeaderContentType = "Content-Type" // HeaderAuthorization 授权 HeaderAuthorization = "Authorization" // HeaderContentDisposition 下载时的附件名指定 HeaderContentDisposition = "Content-disposition" // HttpMethodGet GET方法 HttpMethodGet HttpMethod = "GET" // HttpMethodPost POST方法 HttpMethodPost HttpMethod = "POST" // HttpMethodPut PUT方法 HttpMethodPut HttpMethod = "PUT" // HttpMethodDelete DELETE方法 HttpMethodDelete HttpMethod = "DELETE" // HttpMethodPatch PATCH方法 HttpMethodPatch HttpMethod = "PATCH" // HttpMethodHead HEAD方法 HttpMethodHead HttpMethod = "HEAD" // HttpMethodOptions OPTIONS方法 HttpMethodOptions HttpMethod = "OPTIONS" )
Variables ¶
This section is empty.
Functions ¶
func ContentDisposition ¶
func ContentDisposition(filename string, dispositionType ContentDispositionType) (disposition string)
ContentDisposition 解决附件下载乱码
func Set ¶ added in v0.1.3
func Set[T any](setter func(value T), first T, second T)
Set 设置方法,当`first`值为零值时,设置为`second`的值,否则设置`first`的值
Types ¶
type Case ¶ added in v0.1.3
type Case string
Case 字符串转换
func (*Case) Underscore ¶ added in v0.1.3
Underscore 转为下划线写法
type ContentDispositionType ¶
type ContentDispositionType string
ContentDispositionType 下载类型
const ( // ContentDispositionTypeAttachment 附件下载 ContentDispositionTypeAttachment ContentDispositionType = "attachment" // ContentDispositionTypeInline 浏览器直接打开 ContentDispositionTypeInline ContentDispositionType = "inline" )
type HttpParameterType ¶
type HttpParameterType string
HttpParameterType Http额外参数类型
const ( // HttpParameterTypeHeader 请求头 HttpParameterTypeHeader HttpParameterType = "header" // HttpParameterTypePathParameter 路径参数 HttpParameterTypePathParameter HttpParameterType = "path" )
type Size ¶
type Size int64
Size 字节大小
func (*Size) MarshalJSON ¶ added in v0.0.7
func (*Size) UnmarshalJSON ¶ added in v0.0.7
type UriScheme ¶ added in v0.1.3
type UriScheme string
UriScheme 协议
const ( // UriSchemeUnknown 未知协议 UriSchemeUnknown UriScheme = `` // UriSchemeSocksV4 Socks协议 UriSchemeSocksV4 UriScheme = "socks4" // UriSchemeSocksV5 Socks协议 UriSchemeSocksV5 UriScheme = "socks4" // UriSchemeHttp Http协议 UriSchemeHttp UriScheme = "http" // UriSchemeHttps Https协议 UriSchemeHttps UriScheme = "https" // UriSchemeRtmp Rtmp协议 UriSchemeRtmp UriScheme = "rtmp" // UriSchemeMqtt MQTT协议 UriSchemeMqtt UriScheme = "mqtt" // UriSchemeMqtts MQTT安全协议 UriSchemeMqtts UriScheme = "mqtts" // UriSchemeWs Websocket协议 UriSchemeWs UriScheme = "ws" // UriSchemeWss Websocket安全协议 UriSchemeWss UriScheme = "wss" )
Source Files
¶
Click to show internal directories.
Click to hide internal directories.