Versions in this module Expand all Collapse all v0 v0.0.11 Oct 19, 2021 v0.0.10 Sep 28, 2021 Changes in this version + var Epoch int64 = 1288834974657 + var ErrInvalidBase32 = errors.New("invalid base32") + var ErrInvalidBase58 = errors.New("invalid base58") + var NodeBits uint8 = 10 + var StepBits uint8 = 12 + func CheckNotExist(src string) bool + func CheckPermission(src string) bool + func Contains(obj interface{}, target interface{}) (bool, error) + func Downloader(c *gin.Context, fileName, filePath string) + func GenerateToken(username, accessToken string, expireTime int64) (string, error) + func GetSSLCrtContent() string + func GetSSLKeyContent() string + func GetWeekendInYear(timestamp int64) int + func IsNotExistMkDir(src string) error + func Md5(value string) string + func MustOpen(fileName, filePath string) (*os.File, error) + func Open(name string, flag int, perm os.FileMode) (*os.File, error) + func PageInfo(c *gin.Context, total int64) (page int, limit int) + func ParseDuration(d string) time.Duration + func ParseStrTimeCondition(timeCondition *TimeCondition, timeField string, where map[string]interface{}) map[string]interface + func PasswordHash(pwd []byte) string + func PasswordVerify(hashedPwd string, plainPwd string) bool + func RespFailed(c *gin.Context, code ErrCodeStringify, data interface{}) + func RespSuccess(c *gin.Context, data interface{}) + func RespValidateFailed(c *gin.Context, err error) + func RespWithError(c *gin.Context, code ErrCodeStringify, err error, data interface{}) + func SetSize(s int) + func SetUp(keyPath, certPath string, pageSize int) + func SetUpSSL(privateKey, publicKey string) + func StrPad(str string, placeholder string, overallLen int) string + func TrimHandlerName(handler string) string + func ValidatorAddon() + type Claims struct + AccessToken string + Username string + func ParseToken(token string) (*Claims, error) + type ErrCode int + const Error + const ErrorAuth + const ErrorAuthCheckTokenExpired + const ErrorAuthCheckTokenFail + const ErrorAuthCheckTokenRevoked + const ErrorAuthToken + const ErrorExist + const ErrorMakeDirFailure + const ErrorNotExist + const ErrorOperationAddFailure + const ErrorOperationDeleteFailure + const ErrorOperationQueryListFailure + const ErrorOperationUpdateFailure + const ErrorUserNameExist + const InvalidAccess + const InvalidParams + const NotAuthorize + const Success + func (i ErrCode) String() string + type ErrCodeStringify interface + String func() string + type HttpRespFailed struct + Code int + Data interface{} + Msg string + type ID int64 + func ParseBase2(id string) (ID, error) + func ParseBase32(b []byte) (ID, error) + func ParseBase36(id string) (ID, error) + func ParseBase58(b []byte) (ID, error) + func ParseBase64(id string) (ID, error) + func ParseBytes(id []byte) (ID, error) + func ParseInt64(id int64) ID + func ParseIntBytes(id [8]byte) ID + func ParseString(id string) (ID, error) + func (f *ID) UnmarshalJSON(b []byte) error + func (f ID) Base2() string + func (f ID) Base32() string + func (f ID) Base36() string + func (f ID) Base58() string + func (f ID) Base64() string + func (f ID) Bytes() []byte + func (f ID) Int64() int64 + func (f ID) IntBytes() [8]byte + func (f ID) MarshalJSON() ([]byte, error) + func (f ID) Node() int64 + func (f ID) Step() int64 + func (f ID) String() string + func (f ID) Time() int64 + type JSONSyntaxError struct + func (j JSONSyntaxError) Error() string + type Node struct + func NewNode(node int64) (*Node, error) + func (n *Node) Generate() ID + type TimeCondition struct + EndTime int + StartTime int