web

package
v1.7.2 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2023 License: BSD-3-Clause Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DataCookieID is the cookie identifier for storing additional data.
	DataCookieID = "odootools-data"
)
View Source
const (
	// SessionCookieID is the session cookie identifier.
	SessionCookieID = "odootools"
)

Variables

This section is empty.

Functions

func EmbeddedFile added in v0.6.0

func EmbeddedFile(fs embed.FS, fileName string, contentType string) echo.HandlerFunc

func Healthz

func Healthz(e echo.Context) error

Types

type Server

type Server struct {
	Echo *echo.Echo
	// contains filtered or unexported fields
}

func NewServer

func NewServer(
	odoo *odoo.Client,
	secretKey string,
	dbName string,
	versionInfo VersionInfo,
) *Server

func (*Server) EmployeeReport added in v0.10.0

func (s *Server) EmployeeReport(e echo.Context) error

EmployeeReport GET /report/employees/:year/:month

func (*Server) EmployeeReportUpdate added in v0.11.0

func (s *Server) EmployeeReportUpdate(e echo.Context) error

EmployeeReportUpdate POST /report/employee/:employee/:year/:month. Updates the payslip with the overtime value of the given month.

func (*Server) GetOdooSession added in v0.6.0

func (s *Server) GetOdooSession(e echo.Context) *odoo.Session

GetOdooSession returns the Odoo session from the session cookie. Returns nil if there is no active session.

func (*Server) GetSessionData added in v0.9.0

func (s *Server) GetSessionData(e echo.Context) controller.SessionData

func (Server) Login

func (s Server) Login(e echo.Context) error

Login POST /login

func (Server) LoginForm

func (s Server) LoginForm(e echo.Context) error

LoginForm GET /login

func (Server) Logout

func (s Server) Logout(e echo.Context) error

Logout GET /logout

func (*Server) MonthlyOvertimeReport added in v1.5.0

func (s *Server) MonthlyOvertimeReport(e echo.Context) error

MonthlyOvertimeReport GET /report/:id/:year/:month

func (*Server) ProcessReportInput added in v0.6.0

func (s *Server) ProcessReportInput(e echo.Context) error

ProcessReportInput POST /report

func (Server) RedirectTo added in v0.6.0

func (s Server) RedirectTo(url string) echo.HandlerFunc

func (*Server) RequestReportForm

func (s *Server) RequestReportForm(e echo.Context) error

RequestReportForm GET /report

func (*Server) SaveOdooSession added in v0.6.0

func (s *Server) SaveOdooSession(e echo.Context, odooSession *odoo.Session) error

func (*Server) SaveSessionData added in v0.9.0

func (s *Server) SaveSessionData(e echo.Context, data controller.SessionData) error

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*Server) ShowError added in v0.6.0

func (s *Server) ShowError(e echo.Context, err error) error

func (*Server) YearlyOvertimeReport added in v1.5.0

func (s *Server) YearlyOvertimeReport(e echo.Context) error

YearlyOvertimeReport GET /report/:id/:year

type VersionInfo added in v1.4.0

type VersionInfo struct {
	Version string
	Commit  string
	Date    string
}

func (VersionInfo) String added in v1.4.0

func (vi VersionInfo) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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