www

package
v1.6.3 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: GPL-3.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultHTTPErrorHandler

func DefaultHTTPErrorHandler(err error, c echo.Context)

DefaultHTTPErrorHandler is the default HTTP error handler

func DeleteCookie

func DeleteCookie(c echo.Context, name string)

func SessionMiddleware

func SessionMiddleware() echo.MiddlewareFunc

func SessionTokenAuth

func SessionTokenAuth(next echo.HandlerFunc) echo.HandlerFunc

SessionAuthToken create a request session if a valid API Key is found

func SetSystem

func SetSystem(s *sys.System)

func Setup

func Setup(serverVersion string) *echo.Echo

func StartServer

func StartServer(e *echo.Echo, addr string, autoTLS bool)

Types

type Context

type Context struct {
	echo.Context
	// contains filtered or unexported fields
}

func (*Context) BasicAuth

func (me *Context) BasicAuth() (string, string)

Extract the basic authentication from the header

func (*Context) EndSession

func (me *Context) EndSession()

func (*Context) I18n

func (me *Context) I18n() *WebI18n

func (*Context) Lang

func (me *Context) Lang() string

func (*Context) Session

func (me *Context) Session(create bool) *sys.Session

func (*Context) SessionToken

func (me *Context) SessionToken() string

Extract the session token from the header

func (*Context) SessionWithUser

func (me *Context) SessionWithUser(usr *model.User) *sys.Session

func (*Context) System

func (me *Context) System() *sys.System

type Embedded

type Embedded struct {
	Asset func(name string) ([]byte, error)
}

func (*Embedded) Asset2

func (emb *Embedded) Asset2(name string) ([]byte, error)

func (*Embedded) FindAssetWithContentType

func (emb *Embedded) FindAssetWithContentType(name string, ct *string) ([]byte, error)

type EmbeddedTemplateLoader

type EmbeddedTemplateLoader struct {
	Embedded *Embedded
}

func (*EmbeddedTemplateLoader) Abs

func (htl *EmbeddedTemplateLoader) Abs(base, name string) (absPath string)

Abs calculates the path to a given template. Whenever a path must be resolved due to an import from another template, the base equals the parent template's path.

func (*EmbeddedTemplateLoader) Get

func (htl *EmbeddedTemplateLoader) Get(path string) (io.Reader, error)

Get returns an io.Reader where the template's content can be read from.

type HttpAceptLanguage

type HttpAceptLanguage struct {
	Lang   string
	Weight float64
}

func ParseAcceptLanguageHeader

func ParseAcceptLanguageHeader(headerValue string) []*HttpAceptLanguage

ParseAcceptLanguageHeader reads the weighted header values like de-CH,de;q=0.9,en;q=0.8,en-US;q=0.7 into [{Lang:de-CH, Weight:1} {Lang:de Weight:0.9} {Lang:en Weight:0.8} {Lang:en-US Weight:0.7}]

type InitialHandler

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

func NewInitialHandler

func NewInitialHandler(configured bool) *InitialHandler

func (*InitialHandler) Handler

func (me *InitialHandler) Handler(next echo.HandlerFunc) echo.HandlerFunc

type Security

type Security struct {
}

func NewSecurity

func NewSecurity() *Security

func (*Security) With

func (a *Security) With(role model.Role) echo.MiddlewareFunc

type Translator

type Translator interface {
	T(b ...interface{}) string
}

type WebI18n

type WebI18n struct {
	Lang string
	// contains filtered or unexported fields
}

func NewI18n

func NewI18n(i18nStore storage.I18nIF, c echo.Context) *WebI18n

func (*WebI18n) GetAll

func (wi18n *WebI18n) GetAll() map[string]string

func (*WebI18n) T

func (wi18n *WebI18n) T(b ...interface{}) string

Translate

Jump to

Keyboard shortcuts

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