Documentation ¶
Index ¶
- Constants
- Variables
- func AuthAdmin(r *ghttp.Request)
- func AuthBase(r *ghttp.Request, name string)
- func AuthIndex(r *ghttp.Request)
- func Compress(filePath string) string
- func ConfigInit()
- func CreateCron(ctx context.Context, time string, name string, operate func())
- func CreateDB(ctx context.Context, sqlHost, sqlPort, sqlRoot, sqlPass, baseName string, ...)
- func CreateFileDir() error
- func GetCapitalPass(val string) string
- func GetResult(ctx context.Context, url string, data g.Map, va *gvar.Var) (string, error)
- func InStrArray(ext string, code int) bool
- func LoginJson(r *ghttp.Request, msg string, data ...interface{})
- func MiddlewareError(r *ghttp.Request)
- func NoLogin(r *ghttp.Request)
- func PostResult(ctx context.Context, url string, data g.Map, header string, class string) (string, error)
- func RemoveCron(name string)
- func ResAddFile(onePath string)
- func ResponseJson(ctx context.Context, data interface{})
- func SearchCron(name string) *gcron.Entry
- func Sha256(src string) string
- func Start(agent string, maxSessionTime time.Duration, isApi bool, maxBody ...int64) *ghttp.Server
- func StartCrons(name string)
- func StopCron(name string)
- func Transaction(function func() error)
- type ApiRes
- type Json
- type Logs
- type PageSize
Constants ¶
View Source
const BaseConfig = `` /* 1256-byte string literal not displayed */
Variables ¶
View Source
var ConfigPath = gfile.Pwd() + "/manifest/config/config.yaml"
Functions ¶
func CreateCron ¶ added in v0.0.6
CreateCron 创建定时任务
func CreateDB ¶ added in v0.1.0
CreateDB 创建数据库配置
- @param ctx context.Context
- @param sqlHost string 数据库地址
- @param sqlPort string 数据库端口
- @param sqlRoot string 数据库用户名
- @param sqlPass string 数据库密码
- @param baseName string 数据库名
- @param debug bool 是否开启调试模式
func GetCapitalPass ¶ added in v0.0.6
GetCapitalPass MD5化并转换为大写
func InStrArray ¶ added in v1.0.6
InStrArray 判断是否在数组中
- @param ext string 要判断的字符串
- @param code int
- 判断是否在字符串数组中
func LoginJson ¶ added in v1.0.6
LoginJson 返回登录json数据
- @param ctx 上下文
- @param msg 返回信息
- @param data 返回数据
func PostResult ¶ added in v0.0.6
func PostResult(ctx context.Context, url string, data g.Map, header string, class string) (string, error)
PostResult 建立POST请求并返回结果
func ResAddFile ¶ added in v1.0.6
func ResAddFile(onePath string)
ResAddFile 添加文件到资源包
- @param onePath string
- 例:gf pack resource/dist internal/boot/boot_resource.go -n boot
- 需要在boot中 打包引入 并在main.go中引入boot
func SearchCron ¶ added in v1.0.6
SearchCron 查询定时任务运行状态 如果定时任务未运行则返回NIL 运行则返回运行状态
Types ¶
type ApiRes ¶
type ApiRes struct {
// contains filtered or unexported fields
}
func (*ApiRes) FileDownload ¶ added in v1.0.6
func (*ApiRes) FileSelect ¶ added in v1.0.6
Click to show internal directories.
Click to hide internal directories.