go-admin: github.com/GoAdminGroup/go-admin/plugins/admin/modules/response Index | Files

package response

import "github.com/GoAdminGroup/go-admin/plugins/admin/modules/response"

Index

Package Files

response.go

Variables

var OffLineHandler = func(ctx *context.Context) {
    if config.GetSiteOff() {
        if ctx.WantHTML() {
            ctx.HTML(http.StatusOK, `<html><body><h1>The website is offline</h1></body></html>`)
        } else {
            ctx.JSON(http.StatusForbidden, map[string]interface{}{
                "code": http.StatusForbidden,
                "msg":  language.Get(errors.SiteOff),
            })
        }
        ctx.Abort()
    }
}

func Alert Uses

func Alert(ctx *context.Context, desc, title, msg string, conn db.Connection, btns *types.Buttons,
    pageType ...template.PageType)

func BadRequest Uses

func BadRequest(ctx *context.Context, msg string)

func Denied Uses

func Denied(ctx *context.Context, msg string)

func Error Uses

func Error(ctx *context.Context, msg string)

func Ok Uses

func Ok(ctx *context.Context)

func OkWithData Uses

func OkWithData(ctx *context.Context, data map[string]interface{})

func OkWithMsg Uses

func OkWithMsg(ctx *context.Context, msg string)

Package response imports 10 packages (graph) and is imported by 6 packages. Updated 2020-08-01. Refresh now. Tools for package owners.