web

package
v6.2.13 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2026 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Overview

Package web provides primitives to interact with the openapi HTTP API.

Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.4.1 DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterHandlers

func RegisterHandlers(router EchoRouter, si ServerInterface)

RegisterHandlers adds each server route to the EchoRouter.

func RegisterHandlersWithBaseURL

func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL string)

Registers handlers, and prepends BaseURL to the paths, so that the paths can be served under a prefix.

Types

type EchoRouter

type EchoRouter interface {
	CONNECT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	DELETE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	GET(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	HEAD(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	OPTIONS(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	PATCH(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	POST(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	PUT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	TRACE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
}

This is a simple interface which specifies echo.Route addition functions which are present on both echo.Echo and echo.Group, since we want to allow using either of them for path registration

type EmployeeIDForm

type EmployeeIDForm struct {
	// Choice The choice of the user to either confirm or cancel the signing of the contract.
	Choice EmployeeIDFormChoice `json:"choice"`

	// Secret The secret for this signing session.
	Secret string `json:"secret"`
}

EmployeeIDForm defines model for EmployeeIDForm.

type EmployeeIDFormChoice

type EmployeeIDFormChoice string

EmployeeIDFormChoice The choice of the user to either confirm or cancel the signing of the contract.

const (
	Cancel  EmployeeIDFormChoice = "cancel"
	Confirm EmployeeIDFormChoice = "confirm"
)

Defines values for EmployeeIDFormChoice.

type HandleEmployeeIDFormFormdataRequestBody

type HandleEmployeeIDFormFormdataRequestBody = EmployeeIDForm

HandleEmployeeIDFormFormdataRequestBody defines body for HandleEmployeeIDForm for application/x-www-form-urlencoded ContentType.

type Handler

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

func NewHandler

func NewHandler(store types.SessionStore) *Handler

func (Handler) HandleEmployeeIDForm

func (h Handler) HandleEmployeeIDForm(ctx echo.Context, sessionID SessionID) error

func (Handler) RenderEmployeeIDPage

func (h Handler) RenderEmployeeIDPage(ctx echo.Context, sessionID SessionID) error

func (Handler) Routes

func (h Handler) Routes(router core.EchoRouter)

Routes registers the Echo routes for the API.

type PageData

type PageData struct {
	Session types.Session
}

PageParams is the data that is passed to the template

type ServerInterface

type ServerInterface interface {
	// Render the employee ID page
	// (GET /public/auth/v1/means/employeeid/{sessionID})
	RenderEmployeeIDPage(ctx echo.Context, sessionID SessionID) error
	// Handle the employee ID form.
	// (POST /public/auth/v1/means/employeeid/{sessionID})
	HandleEmployeeIDForm(ctx echo.Context, sessionID SessionID) error
}

ServerInterface represents all server handlers.

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler ServerInterface
}

ServerInterfaceWrapper converts echo contexts to parameters.

func (*ServerInterfaceWrapper) HandleEmployeeIDForm

func (w *ServerInterfaceWrapper) HandleEmployeeIDForm(ctx echo.Context) error

HandleEmployeeIDForm converts echo context to params.

func (*ServerInterfaceWrapper) RenderEmployeeIDPage

func (w *ServerInterfaceWrapper) RenderEmployeeIDPage(ctx echo.Context) error

RenderEmployeeIDPage converts echo context to params.

type SessionID

type SessionID = string

SessionID defines model for sessionID.

type Templates

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

func NewTemplates

func NewTemplates() *Templates

func (Templates) Render

func (t Templates) Render(name string, lang contract.Language, pageData PageData, target io.Writer) error

Render renders the template with the given name and language to the target writer.

Jump to

Keyboard shortcuts

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