response

package
v1.2.27 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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()
	}
}

Functions

func Alert

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

func BadRequest

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

func Denied

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

func Error

func Error(ctx *context.Context, msg string, datas ...map[string]interface{})

func Ok

func Ok(ctx *context.Context)

func OkWithData

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

func OkWithMsg

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

Types

This section is empty.

Jump to

Keyboard shortcuts

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