renderer

package
v3.37.3 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Redirect added in v3.34.2

func Redirect(w http.ResponseWriter, r *http.Request, pathname string, message Message)

Redirect redirect user to a defined path with a message

Types

type App

type App interface {
	Handler(TemplateFunc) http.Handler
	Error(http.ResponseWriter, error)
}

App of package

func New

func New(config Config, funcMap template.FuncMap) (App, error)

New creates new App from Config

type Config

type Config struct {
	// contains filtered or unexported fields
}

Config of package

func Flags

func Flags(fs *flag.FlagSet, prefix string, overrides ...flags.Override) Config

Flags adds flags for configuring package

type Message added in v3.36.1

type Message struct {
	Level   string
	Content string
}

Message for render

func NewErrorMessage added in v3.36.1

func NewErrorMessage(format string, a ...interface{}) Message

NewErrorMessage create a error message

func NewSuccessMessage added in v3.36.1

func NewSuccessMessage(format string, a ...interface{}) Message

NewSuccessMessage create a success message

func ParseMessage added in v3.36.1

func ParseMessage(r *http.Request) Message

ParseMessage parses messages from request

func (Message) String added in v3.36.1

func (m Message) String() string

type TemplateFunc added in v3.36.1

type TemplateFunc = func(*http.Request) (string, int, map[string]interface{}, error)

TemplateFunc handle a request and returns which template to render with which status and datas

Jump to

Keyboard shortcuts

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