Documentation ¶
Index ¶
- Constants
- Variables
- func BlogDB() *gorm.DB
- func CloseDB() error
- func Default() (r *gin.Engine)
- func DeleteTaskID(ctx *gin.Context) (any, error)
- func DownloadAssets(blog *model.Blog)
- func Error(ctx *gin.Context, err error)
- func Get(ctx *gin.Context) (any, error)
- func GetBlogID(ctx *gin.Context) (any, error)
- func GetBlogs(ctx *gin.Context) (any, error)
- func GetExecute(ctx *gin.Context) (any, error)
- func GetOnline(ctx *gin.Context) (any, error)
- func GetPing(ctx *gin.Context) (any, error)
- func GetShutdown(ctx *gin.Context) (any, error)
- func GetTaskID(ctx *gin.Context) (any, error)
- func GetToken(ctx *gin.Context) (data any, err error)
- func GetUID(ctx *gin.Context) string
- func GetUUID(ctx *gin.Context) (any, error)
- func GetUserUID(ctx *gin.Context) (any, error)
- func GetValid(ctx *gin.Context) (any, error)
- func GetVersion(ctx *gin.Context) (any, error)
- func Index(ctx *gin.Context)
- func Info(ctx *gin.Context)
- func IsAdmin(ctx *gin.Context)
- func IsOwner(ctx *gin.Context)
- func IsUser(ctx *gin.Context)
- func JWTAuth(ctx *gin.Context) (uid string, err error)
- func JWTSecretKey(*jwt.Token) (any, error)
- func JWTUser(ctx *gin.Context) (user *model.User, err error)
- func LoadDir(root, path string) error
- func LoadFile(root, file string)
- func Log() *logrus.Logger
- func LogMiddleware(ctx *gin.Context)
- func New() (r *gin.Engine)
- func PatchTaskID(ctx *gin.Context) (any, error)
- func PatchUser(ctx *gin.Context) (any, error)
- func PatchUserBan(ctx *gin.Context, me, user *model.User, patch PatchBody) error
- func PatchUserName(ctx *gin.Context, me, user *model.User, patch PatchBody) error
- func PatchUserNickname(ctx *gin.Context, me, user *model.User, patch PatchBody) error
- func PatchUserRole(ctx *gin.Context, me, user *model.User, patch PatchBody) error
- func PostBlog(ctx *gin.Context) (any, error)
- func PostFilter(ctx *gin.Context) (any, error)
- func PostRegister(ctx *gin.Context) (any, error)
- func PostTask(ctx *gin.Context) (any, error)
- func PostTest(ctx *gin.Context) (any, error)
- func PostTests(ctx *gin.Context) (any, error)
- func PostUpload(ctx *gin.Context) (any, error)
- func UserDB() *gorm.DB
- type PatchBody
- type UserClaims
Constants ¶
View Source
const ( ErrInvalidOp = `invalid patch op: "%s"` ErrInvalidPath = `invalid patch path: "%s"` )
View Source
const MagicUIDKey string = "_magic_uid_key_"
View Source
const Version = "v0.18.0"
Variables ¶
View Source
var ( ErrAuthNotExist = errors.New("webhook/api: Authorization does not exist") ErrBlogNotExist = errors.New("webhook/api: blog does not exist") ErrUserNotExist = errors.New("webhook/api: user does not exist") ErrTaskNotExist = errors.New("webhook/api: task does not exist") ErrFilterNotExist = errors.New("webhook/api: filter does not exist") ErrExpired = errors.New("webhook/api: token is expired") ErrPermDenied = errors.New("webhook/api: permission denied") ErrUserRegistered = errors.New("webhook/api: user registered") ErrIncorrectPwd = errors.New("webhook/api: incorrect password") ErrBanned = errors.New("webhook/api: user has been banned") )
View Source
var AutoDownload bool
开启自动下载会极大的占用带宽 建议发送完所有 hook 请求后再下载
Functions ¶
func LogMiddleware ¶ added in v0.15.0
func PatchUserBan ¶ added in v0.15.0
func PatchUserName ¶ added in v0.15.0
func PatchUserNickname ¶ added in v0.15.0
func PatchUserRole ¶ added in v0.15.0
Types ¶
type UserClaims ¶ added in v0.15.0
func (UserClaims) TableName ¶ added in v0.17.3
func (UserClaims) TableName() string
func (UserClaims) Valid ¶ added in v0.15.0
func (c UserClaims) Valid() error
Click to show internal directories.
Click to hide internal directories.