api

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: May 10, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoAuthCode = errors.New("webhook/api: no authentication code")
	ErrAuth       = errors.New("webhook/api: authentication failure")
)
View Source
var Api = group.Group{
	Middlewares: gin.HandlersChain{group.CORS},
	Customize: func(r gin.IRouter) {
		r.StaticFS("/public", request.DefaultDownloadSystem(config.Global.Path.FullPath.Public))
	},
	Groups: []group.Group{Visitor, {
		Middlewares: gin.HandlersChain{SetUser},
		Groups:      []group.Group{Submitter, Admin},
	}},
}
View Source
var CmdList string
View Source
var ErrAppoint1 = errors.New("webhook/api: only the owner can appoint the administrator")
View Source
var ErrAppoint2 = errors.New("webhook/api: only the administrator can appoint others")
View Source
var ErrHasOwner = errors.New("webhook/api: there can only be one owner")
View Source
var (
	ErrNoAdmin = errors.New("webhook/api: no administrator permission")
)
View Source
var ErrNoRepost = group.NewError(1, `Form key "repost" not found. A "null" value must be pass in if there is no repost.`)
View Source
var Submitter = group.Group{
	Path: "submitter",

	Handlers: group.Chain{
		GetMe,
		GetPing,
		GetRemove_job,
		GetModify_follow,
		PostSubmit,
		PostAdd_job,
		PostTest_job,
	},
}

Functions

func CheckPermission added in v0.14.0

func CheckPermission(p, n model.Permission) error

func GetClear_public added in v0.14.0

func GetClear_public(ctx *gin.Context) (data any, err group.Error)

func GetClear_root added in v0.14.0

func GetClear_root(ctx *gin.Context) (data any, err group.Error)

func GetDownload_users added in v0.14.0

func GetDownload_users(ctx *gin.Context) (any, group.Error)

func GetEngine added in v0.14.0

func GetEngine() (*gin.Engine, error)

func GetExec added in v0.14.0

func GetExec(ctx *gin.Context) (any, group.Error)

func GetGet_users added in v0.14.0

func GetGet_users(ctx *gin.Context) (any, group.Error)

func GetList added in v0.14.0

func GetList(ctx *gin.Context) (any, group.Error)

查看资源目录

func GetLog added in v0.14.0

func GetLog(ctx *gin.Context) (any, group.Error)

读取日志

func GetMe added in v0.14.0

func GetMe(ctx *gin.Context) (any, group.Error)

获取自身信息

func GetModify_follow added in v0.14.0

func GetModify_follow(ctx *gin.Context) (any, group.Error)

更新监听列表

func GetOnline added in v0.14.0

func GetOnline(ctx *gin.Context) (any, group.Error)

获取当前在线状态

func GetPing added in v0.14.0

func GetPing(ctx *gin.Context) (any, group.Error)

更新在线时间

func GetRegister added in v0.14.0

func GetRegister(ctx *gin.Context) (any, group.Error)

新建用户

func GetRemove_job added in v0.14.0

func GetRemove_job(ctx *gin.Context) (any, group.Error)

移除任务

func GetRestart added in v0.14.0

func GetRestart(ctx *gin.Context) (any, group.Error)

func GetSet_permission added in v0.14.0

func GetSet_permission(ctx *gin.Context) (any, group.Error)

func GetToken

func GetToken(ctx *gin.Context) (any, group.Error)

获取注册所需 Token

func GetUpdate added in v0.14.0

func GetUpdate(ctx *gin.Context) (any, group.Error)

主动更新主页

func GetVersion added in v0.14.0

func GetVersion(ctx *gin.Context) (any, group.Error)

当前版本号

func IsAdmin added in v0.14.0

func IsAdmin(ctx *gin.Context)

func PostAdd_job added in v0.14.0

func PostAdd_job(ctx *gin.Context) (any, group.Error)

新增任务

func PostSubmit added in v0.14.0

func PostSubmit(ctx *gin.Context) (any, group.Error)

提交博文

func PostTest_job added in v0.14.0

func PostTest_job(ctx *gin.Context) (any, group.Error)

测试单个任务

func SetUser added in v0.14.0

func SetUser(ctx *gin.Context)

func WrapError added in v0.14.0

func WrapError(data any, err error) (any, group.Error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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