Documentation ¶
Index ¶
- Constants
- Variables
- func Base642file(b64str string, file string) error
- func CheckEmpty(name string, v interface{})
- func Copy(from, to string) error
- func CopyFile(from io.Reader, to string, mode os.FileMode) error
- func CreateTmpFile(data []byte) (*os.File, error)
- func DeepCopy(value interface{}) interface{}
- func DirExists(file string) bool
- func EmptyToNA(src string) string
- func File2Base64(file string) string
- func FileExists(file string) bool
- func FormatTimeDuration(seconds int64) string
- func GbkToUtf8(s []byte) ([]byte, error)
- func GenValidateCode(width int) string
- func GenerateDataVer() string
- func GenerateRangeNum(min, max int) int
- func GetFieldType(mod interface{}, name string) string
- func GetPointBool(s *bool) bool
- func GetPointInt64(s *int64) int64
- func GetPointString(s *string) string
- func GetPointTime(s *time.Time) time.Time
- func If(condition bool, trueVal, falseVal interface{}) interface{}
- func IfEmpty(src interface{}, defval interface{}) interface{}
- func IfEmptyStr(src string, defval string) string
- func IfNA(src string, defval string) string
- func IgnoreError(v interface{}, err error) interface{}
- func InSlice(v string, sl []string) bool
- func IsEmpty(value interface{}) bool
- func IsEmptyOrNA(val string) bool
- func IsNotEmpty(value interface{}) bool
- func IsNotEmptyAndNA(val string) bool
- func JsonMarshal(v interface{}) ([]byte, error)
- func JsonUnmarshal(data []byte, v interface{}) error
- func MakeDir(path string)
- func Md5Hash(src string) string
- func Md5HashFile(filePath string) (string, error)
- func MobileAgent(userAgent string) string
- func Must(err error)
- func Must2(v interface{}, err error) interface{}
- func MustCallBefore(err error, callbefore func())
- func MustDebug(err error, debug bool)
- func MustNotEmpty(name string, v interface{})
- func MustStringValue(val string, err error) string
- func NextDataVar() string
- func ParseFloat64(v interface{}) (float64, error)
- func ParseInt64(v interface{}) (int64, error)
- func ParseString(v interface{}) (string, error)
- func ReplaceNaN(v float64, r float64) float64
- func SetEmptyStrToNA(t interface{})
- func Sha1Hash(src string) string
- func Sha256Hash(src string) string
- func Sha256HashWithSalt(src string, salt string) string
- func StructToMap(obj interface{}) (newMap map[string]interface{}, err error)
- func ToCamelCase(str string) string
- func ToGbkHexString(src string) (string, error)
- func ToGbkString(src string) (string, error)
- func ToJson(v interface{}) string
- func ToSnakeCase(str string) string
- func Translate(text, from, to string) (string, error)
- func TrimBytes(src []byte) []byte
- func UUID() string
- func UUIDBase32() (string, error)
- func UUIDint64() int64
- func UrlJoin(hurl string, elm ...string) string
- func UrlJoin2(hurl string, elm ...string) string
- func Usage(str string)
- func Utf8ToGbk(s []byte) ([]byte, error)
Constants ¶
View Source
const ( NA = "N/A" ENABLED = "enabled" DISABLED = "disabled" SecretSalt = "Teamsacsca172021" )
Variables ¶
View Source
var ( EmptyList []interface{} EmptyData map[string]interface{} ShangHaiLOC, _ = time.LoadLocation("Asia/Shanghai") )
Functions ¶
func Base642file ¶
func CheckEmpty ¶
func CheckEmpty(name string, v interface{})
func CreateTmpFile ¶
create a file to test the upload and download.
func File2Base64 ¶
func FileExists ¶
func FormatTimeDuration ¶
func GenerateDataVer ¶
func GenerateDataVer() string
func GenerateRangeNum ¶
func GetFieldType ¶
func GetPointBool ¶
func GetPointInt64 ¶
func GetPointString ¶
func IfEmptyStr ¶
func IgnoreError ¶
func IgnoreError(v interface{}, err error) interface{}
func IsEmpty ¶
func IsEmpty(value interface{}) bool
IsEmpty checks if a value is empty or not. A value is considered empty if - integer, float: zero - bool: false - string, array: len() == 0 - slice, map: nil or len() == 0 - interface, pointer: nil or the referenced value is empty
func IsEmptyOrNA ¶
func IsNotEmpty ¶
func IsNotEmpty(value interface{}) bool
func IsNotEmptyAndNA ¶
func JsonMarshal ¶
func JsonUnmarshal ¶
func Md5HashFile ¶
func MobileAgent ¶
func MustCallBefore ¶
func MustCallBefore(err error, callbefore func())
func MustNotEmpty ¶
func MustNotEmpty(name string, v interface{})
func NextDataVar ¶
func NextDataVar() string
func ParseFloat64 ¶
func ParseInt64 ¶
func ParseString ¶
func ReplaceNaN ¶
func SetEmptyStrToNA ¶
func SetEmptyStrToNA(t interface{})
func Sha256Hash ¶
func Sha256HashWithSalt ¶
func StructToMap ¶
func ToGbkHexString ¶
func ToGbkString ¶
func UUIDBase32 ¶
Types ¶
This section is empty.
Directories ¶
Path | Synopsis |
---|---|
This package wraps the standard XML library and uses it to build a node tree of any document you load.
|
This package wraps the standard XML library and uses it to build a node tree of any document you load. |
Click to show internal directories.
Click to hide internal directories.