util

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: May 28, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SocketConMap = make(map[string]socketio.Conn)

Functions

func CreateToken

func CreateToken(uid, secret string) (string, error)

CreateToken 生成jwt

func GeneratePassword

func GeneratePassword(mobile string) string

*

  • 生成密码

func GetMD5

func GetMD5(password string) string

*

  • md5加密

func NewCookie added in v1.4.0

func NewCookie(rawCookies string) myCookie

将字符串cookie转换为数组cookie

func ParseToken

func ParseToken(token string, secret string) (string, error)

ParseToken 解密jwt

func PathExists

func PathExists(path string) bool

PathExists 判断文件或文件夹是否存在

func SendSocketMsg added in v1.4.0

func SendSocketMsg(uid, msg string)

Types

type Config

type Config struct {
	Port        string `yaml:"port"`        // 服务端口
	Dialects    string `yaml:"dialects"`    // 使用的数据库类型:mysql,sqlite3
	Dbpath      string `yaml:"dbpath"`      // sqlite数据库文件位置或mysql连接地址
	Env         string `yaml:"env"`         // 执行环境
	DingTalk    string `yaml:"dingTalk"`    // 钉钉webhook
	MailHost    string `yaml:"mailHost"`    // 邮件服务器地址
	MailPort    int    `yaml:"mailPort"`    // 邮件端口
	MailUser    string `yaml:"mailUser"`    // 邮件发送账户
	MailPWD     string `yaml:"mailPWD"`     // 邮件授权密码
	DelayDeploy int    `yaml:"delayDeploy"` // 延时发布时间,单位秒。默认5分钟
	JWTSecret   string `yaml:"JWTSecret"`   // jwt安全密匙
	HostName    string `yaml:"hostName"`    // 服务地址,用于重置密码邮件中的链接
	APPDir      string `yaml:"appDir"`      // 要发布的应用存储目录
}

profile variables

var Conf *Config

保存数据变量

func GetConf

func GetConf(filename string) (*Config, error)

type SocketData added in v1.4.0

type SocketData struct {
	Time   string
	Msg    string
	Status int
}

Jump to

Keyboard shortcuts

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