utils

package
v0.0.0-...-887e490 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2021 License: GPL-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(data []byte, to interface{}) error

------------------- Decode 用gob进行数据解码

func DelCache

func DelCache(key string) error

func Encode

func Encode(data interface{}) ([]byte, error)

-------------------- Encode 用gob进行数据编码

func GetAvatar

func GetAvatar(avatar string) string

func GetAvatarSource

func GetAvatarSource(avatar string) string

func GetBrowser

func GetBrowser(browser string) string

func GetCache

func GetCache(key string, to interface{}) error

func GetCheckworkType

func GetCheckworkType(ctype int) string

func GetDate

func GetDate(timestamp int64) string

func GetDateFormat

func GetDateFormat(timestamp int64, format string) string

func GetDateMH

func GetDateMH(timestamp int64) string

func GetDateParse

func GetDateParse(dates string) int64

func GetEdu

func GetEdu(edu int) string

func GetFileSuffix

func GetFileSuffix(s string) string

func GetGuid

func GetGuid() string

Guid方法

func GetLeaveType

func GetLeaveType(ltype int) string

func GetMessageSubtype

func GetMessageSubtype(subtype int) string

11知识评论12相册评论21知识赞22相册赞31请假审批32加班33报销34出差35外出36物品

func GetMessageType

func GetMessageType(ctype int) string

func GetNeedsSource

func GetNeedsSource(source int) string

func GetNeedsStage

func GetNeedsStage(stage int) string

func GetNeedsStatus

func GetNeedsStatus(status int) string

func GetOs

func GetOs(os string) string

func GetResumeStatus

func GetResumeStatus(status int) string

func GetTaskStatus

func GetTaskStatus(status int) string

func GetTaskType

func GetTaskType(tasktype int) string

func GetTestStatus

func GetTestStatus(status int) string

func GetTimeParse

func GetTimeParse(times string) int64

func GetWorkYear

func GetWorkYear(year int) string

func HTMLEncode

func HTMLEncode(rs string) string

func InitCache

func InitCache()

func LoadImage

func LoadImage(path string) (img image.Image, err error)

Load Image decodes an image from a file of image.

func Md5

func Md5(s string) string

md5方法

func RandInt64

func RandInt64(min, max int64) int64

func RemoveDuplicatesAndEmpty

func RemoveDuplicatesAndEmpty(a []string) (ret []string)

数组去重来源网络

func SendMail

func SendMail(to string, subject string, body string) error

*

  • to: example@example.com;example1@163.com;example2@sina.com.cn;...
  • subject:The subject of mail
  • body: The content of mail

func SetCache

func SetCache(key string, value interface{}, timeout int) error

func SnowFlakeId

func SnowFlakeId() int64

func Strim

func Strim(str string) string

func SubString

func SubString(s string, pos, length int) string
func AjaxMsg(code int, message string) {
	this.Data["json"] = map[string]interface{}{"code": code, "message": message}
	this.ServeJSON()
	return
}

字串截取

func Unicode

func Unicode(rs string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL