cbwebcommon

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2020 License: MIT Imports: 17 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultErrorHandler

type DefaultErrorHandler struct{}

func (DefaultErrorHandler) Error

func (d DefaultErrorHandler) Error(e error)

type ErrorHandler

type ErrorHandler interface {
	Error(e error)
	Recover()
}

type FileOpener

type FileOpener interface {
	Open(name string) (http.File, error)
}

type Logger

type Logger interface {
	InfoF(category string, message string, args ...interface{})
}

type Module

type Module struct {
	Env              string
	Version          string
	FileServer       func(ctx *fasthttp.RequestCtx)
	FourOFourError   func(ctx *fasthttp.RequestCtx)
	FiveHundredError func(ctx *fasthttp.RequestCtx)
	TemplateFuncs    template.FuncMap
	TemplatesBox     FileOpener
	WebAssets        FileOpener
	ErrorHandler     ErrorHandler
	Logger           Logger
	// contains filtered or unexported fields
}

func (*Module) DefaultFileServer

func (m *Module) DefaultFileServer(ctx *fasthttp.RequestCtx)

func (*Module) DefaultFiveHundredError

func (m *Module) DefaultFiveHundredError(ctx *fasthttp.RequestCtx)

func (*Module) DefaultFourOFourError

func (m *Module) DefaultFourOFourError(ctx *fasthttp.RequestCtx)

func (*Module) GenerateTemplate

func (m *Module) GenerateTemplate(fileNames []string) (*templates.InheritanceMultiTemplate, error)

func (*Module) GetFiveHundredError

func (m *Module) GetFiveHundredError() func(ctx *fasthttp.RequestCtx)

func (*Module) GetGlobalTemplates

func (m *Module) GetGlobalTemplates() map[string][]byte

func (*Module) SetDefaultHandlers

func (m *Module) SetDefaultHandlers()

func (*Module) SetGlobalTemplates

func (m *Module) SetGlobalTemplates(templates map[string][]byte)

func (*Module) SetRoutes

func (m *Module) SetRoutes(routes *router.Router)

Jump to

Keyboard shortcuts

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