view

package
v0.0.0-...-25db8eb Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PARAM_ERR_CODE = "code"
	PARAM_ERR_MSG  = "msg"
)
View Source
const (
	NTC_PARAM        = "ntc"
	NTC_TYPE_INFO    = "info"
	NTC_TYPE_ERROR   = "error"
	NTC_TYPE_WARNING = "warn"
	NTC_TYPE_SUCCESS = "succ"
)
View Source
const (
	TEMPLATE_DIR    = "tmpl/"
	TMP_ROOT        = "root.twig"
	TMP_NOTICE      = "notice.twig"
	TMP_ERR_DEBUG   = "error/debug.twig"
	TMP_ERROR       = "error/http_error.twig"
	TMP_LANG_DETAIL = "lang/detail.twig"
	TMP_LANG_UPDATE = "lang/update.twig"
	TMP_WORD_UPDATE = "word/update.twig"
)

Variables

View Source
var G_showDebug = false

Functions

func CustomErrorHandler

func CustomErrorHandler(err error, c echo.Context)

func ErrorNotice

func ErrorNotice(title, text string) string

func FailRequestWithError

func FailRequestWithError(c echo.Context, msg string, err error, redirUrl string) error

func InfoNotice

func InfoNotice(title, text string) string

func InitTemplates

func InitTemplates()

func NoticeParam

func NoticeParam(kind, title, text string) string

func RenderTemplate

func RenderTemplate(c echo.Context, tmplPath string, d Data) error

func SuccessNotice

func SuccessNotice(title, text string) string

Types

type Data

type Data map[string]stick.Value

type Notice

type Notice struct {
	Type  string
	Title string
	Text  string
}

func GetNotice

func GetNotice(c echo.Context) *Notice

Jump to

Keyboard shortcuts

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