controller

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2022 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const HRManagerRoleKey = "HRManager"

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	Echo        echo.Context
	OdooClient  *model.Odoo
	OdooSession *odoo.Session
	SessionData SessionData
}

type Renderer

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

Renderer is able to render HTML templates. Templates will be compiled the first time they are requested, and cached thereafter.

func NewRenderer

func NewRenderer() *Renderer

NewRenderer returns a new "Renderer" struct

func (*Renderer) Render

func (v *Renderer) Render(w io.Writer, name string, data interface{}, c echo.Context) error

Render renders the requested template with the given data into w. "template" is suffixed with ".html", and then rendered together with "layout.html".

type SessionData added in v0.9.0

type SessionData struct {
	Employee *model.Employee `json:"employee"`
	Roles    []string        `json:"roles"`
}

SessionData is an additional data struct. Its purpose is to store data in a session cookie in order to avoid repetitive Odoo API calls.

type Values

type Values map[string]interface{}

Values is an arbitrary tree of data to be passed to Template rendering.

func AsError

func AsError(err error) Values

Jump to

Keyboard shortcuts

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