Utils

package
Version: v0.0.0-...-1446c6c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 22, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const UserInfoDir = "/UserInfo/"

Variables

View Source
var (
	Success_200                   = 200
	Error_token_201               = 201
	Error_user_password_202       = 202
	Error_update_userpassword_203 = 203
	Error_invalid_mobile_204      = 204
	Error_invalid_token_205       = 205
	Error_user_create_206         = 206
	Error_invalid_sms_207         = 207
)
View Source
var CodeNum map[int]string

Functions

func CheckJsonSync

func CheckJsonSync(Jstr []byte) ([]byte, bool)

func Checkfilesynckind

func Checkfilesynckind(kind string) bool

func CodeNumInit

func CodeNumInit()

func CreateCaptcha

func CreateCaptcha() string

func Debug

func Debug() (string, bool)

func Getdatapath

func Getdatapath() string

func InitUtils

func InitUtils()

func IsDir

func IsDir(path string) bool

判断所给路径是否为文件夹

func IsFile

func IsFile(path string) bool

判断所给路径是否为文件

func PathExists

func PathExists(path string) (bool, error)

func Pwd

func Pwd() string

func SHA256Encode

func SHA256Encode(s string) string

func TimeDiffForHumans

func TimeDiffForHumans(t time.Time) string

func ToString

func ToString(i interface{}) string

func Url

func Url(url string, params ...interface{}) string

func VerifyEmailFormat

func VerifyEmailFormat(email string) bool

func VerifyMobileFormat

func VerifyMobileFormat(mobileNum string) bool

mobile verify

Types

type BootstrapPaginator

type BootstrapPaginator struct {
	Total       int64
	CurrentPage int64
	Url         string
	PerPage     int64
	TotalPage   int64
	Appends     map[string]string
}

func (*BootstrapPaginator) Append

func (bp *BootstrapPaginator) Append(params map[string]string)

func (*BootstrapPaginator) BuildUrl

func (bp *BootstrapPaginator) BuildUrl(Page int64) string

func (*BootstrapPaginator) ComputeTotalPage

func (bp *BootstrapPaginator) ComputeTotalPage()

func (*BootstrapPaginator) Instance

func (bp *BootstrapPaginator) Instance(total int64, currentPage int64, perPage int64, url string)

func (*BootstrapPaginator) Render

func (bp *BootstrapPaginator) Render() string

func (*BootstrapPaginator) RenderItem

func (bp *BootstrapPaginator) RenderItem(page int64) string

func (*BootstrapPaginator) RenderNextItem

func (bp *BootstrapPaginator) RenderNextItem() string

func (*BootstrapPaginator) RenderPrevItem

func (bp *BootstrapPaginator) RenderPrevItem() string

func (*BootstrapPaginator) RenderUselessItem

func (bp *BootstrapPaginator) RenderUselessItem() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL