Documentation ¶
Index ¶
- Constants
- func AddSlashes(s string) string
- func CreateFile(filename string) (*os.File, error)
- func Date(timestamp int64, format ...string) string
- func IP2Long(ip string) uint32
- func LoadCertFromPfxFile(pfxFile, password string) (tls.Certificate, error)
- func Long2IP(ip uint32) string
- func MarshalNoEscapeHTML(v any) ([]byte, error)
- func OpenFile(filename string) (*os.File, error)
- func QuoteMeta(s string) string
- func SetTimezone(loc *time.Location)
- func SliceRand[T any](a []T, n int) []T
- func SliceUniq[T ~int | ~int64 | ~float64 | ~string](a []T) []T
- func StrToTime(datetime string, format ...string) int64
- func StripSlashes(s string) string
- func VersionCompare(rangeVer, curVer string) (bool, error)
- func WeekAround(timestamp int64, format ...string) (monday, sunday string)
- type CDATA
- type X
Constants ¶
View Source
const ( // OK defines for string `OK` OK = "OK" // Default defines for `default` name Default = "default" )
Variables ¶
This section is empty.
Functions ¶
func CreateFile ¶
CreateFile 创建或清空指定的文件 文件已存在,则清空;文件或目录不存在,则以0775权限创建
func LoadCertFromPfxFile ¶
func LoadCertFromPfxFile(pfxFile, password string) (tls.Certificate, error)
LoadCertFromPfxFile 通过pfx(p12)文件生成TLS证书 注意:证书需采用「TripleDES-SHA1」加密方式
func MarshalNoEscapeHTML ¶
MarshalNoEscapeHTML 不带HTML转义的JSON序列化
func VersionCompare ¶
VersionCompare 语义化的版本比较,支持:>, >=, =, !=, <, <=, | (or), & (and). 参数 `rangeVer` 示例:1.0.0, =1.0.0, >2.0.0, >=1.0.0&<2.0.0, <2.0.0|>3.0.0, !=4.0.4
func WeekAround ¶
WeekAround 返回给定时间戳所在的周的「周一」和「周日」;默认格式:2006-01-02 15:04:05
Types ¶
type CDATA ¶
type CDATA string
CDATA XML `CDATA` 标记
func (CDATA) MarshalXML ¶
MarshalXML XML 带 `CDATA` 标记序列化
Click to show internal directories.
Click to hide internal directories.