server

package
v0.0.0-...-77c78fe Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2020 License: GPL-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	Port int
	Mux  *echo.Echo
	App  app.App
}

Server is the top-level server instance.

func New

func New(a app.App) *Server

New initiates a new Server instance and returns it.

func (*Server) Init

func (s *Server) Init(a app.App)

Init sets up some basic parameters of the provided Server instance.

func (*Server) Run

func (s *Server) Run()

Run spins up the server, adds all routes and listens on the provided port. It panics when the server couldn't be started. Panics in the call chain will recover, print a stack trace and the HTTPErrorHandler handles the panic.

type TemplateRenderer

type TemplateRenderer struct {
	Templates *template.Template
}

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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