web

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewError

func NewError(c echo.Context, status int, err error) error

NewError generator

func NewSimpleResponse

func NewSimpleResponse(c echo.Context, status int, message string) error

NewSimpleResponse generator

Types

type App

type App interface {
	GetEcho() *echo.Echo
	Start()
	Shutdown(context.Context) error
}

App of package

func New

func New(config Config, fs fs.FS, loggerApp logger.App, repoApp repositories.App) App

type Config

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

func GetConfig

func GetConfig(fs *flag.FlagSet) Config

type HTTPError

type HTTPError struct {
	Code    int    `json:"code" example:"400"`
	Message string `json:"message" example:"status bad request"`
}

HTTPError struct for formating all erors

type HTTPSuccess

type HTTPSuccess struct {
	Code    int    `json:"code" example:"200"`
	Message string `json:"message" example:"I'm a description"`
}

HTTPSuccess struct for simple response

type TemplateRenderer

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

TemplateRenderer is a custom html/template renderer for Echo framework

func (*TemplateRenderer) Render

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

Render renders a template document

Jump to

Keyboard shortcuts

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