Documentation ¶
Index ¶
- Constants
- func CheckConfig(opts interface{}, parent string) error
- func ClearByteArrayMemory(bs ...[]byte)
- func ClearStringMemory(s ...string)
- func Date() string
- func DateAndTime(n int64) (string, string)
- func DoLog(userid, username, action, access, result string)
- func Expiry(expiry int64) int64
- func ExpiryReduceSecond(expiry int64) time.Time
- func GCD(a, b int) int
- func GenRandoms(max, total int) []int
- func IsChinesePhone(phone string) bool
- func IsExpiry(expiry int64) bool
- func IsPath(url string) bool
- func IsPictureName(pictureName string) bool
- func IsPositiveFloatPoint(num string) bool
- func IsPositiveInterger(num string) bool
- func IsPositiveScientificNotation(num string) bool
- func IsSafeFileName(name string) bool
- func IsTxt(fileName string) bool
- func IsUserName(name string) bool
- func LCM(a, b int) int
- func LoadFromYaml(path string, cfg interface{}) error
- func Now() int64
- func RetryThreeTimes(f func() error)
- func StrLen(s string) int
- func ToDate(n int64) string
- func ToUnixTime(v string) (time.Time, error)
- func ToUnixTimeLayout2(v string) (time.Time, error)
- func XSSFilter(input string) (output string)
- type SymmetricEncryption
Constants ¶
View Source
const ( // number RePositiveInterger = "^[1-9]\\d*$" RePositiveScientificNotation = "^(\\d+(.{0}|.\\d+))[Ee]{1}([\\+|-]?\\d+)$" RePositiveFloatPoint = "^(?:[1-9][0-9]*\\.[0-9]+|0\\.(?!0+$)[0-9]+)$" // file&path ReURL = "[\\w-]+(/[\\w-./?%&=]*)?" ReFileName = "^[a-zA-Z0-9-_\\.]+$" // phone ReChinesePhone = "^1\\d{10}$" // name ReUserName = "^[a-zA-Z0-9_-]+$" )
Variables ¶
This section is empty.
Functions ¶
func ClearByteArrayMemory ¶
func ClearByteArrayMemory(bs ...[]byte)
func ClearStringMemory ¶
func ClearStringMemory(s ...string)
func DateAndTime ¶
func ExpiryReduceSecond ¶
func GenRandoms ¶
func IsChinesePhone ¶
func IsPictureName ¶
func IsPositiveFloatPoint ¶
func IsSafeFileName ¶
func IsUserName ¶
func LoadFromYaml ¶
func RetryThreeTimes ¶
func RetryThreeTimes(f func() error)
Types ¶
type SymmetricEncryption ¶
type SymmetricEncryption interface { Encrypt(plaintext []byte) ([]byte, error) Decrypt(ciphertext []byte) ([]byte, error) }
func NewSymmetricEncryption ¶
func NewSymmetricEncryption(key, nonce string) (SymmetricEncryption, error)
Click to show internal directories.
Click to hide internal directories.