Back to godoc.org

Package server

v0.0.0-...-6da4a28
Latest Go to latest

The highest tagged major version is .

Published: Jul 3, 2020 | License: MIT | Module: github.com/Techassi/gomark

Index

type Server

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

Server is the top-level server instance.

func New

func New(app *app.App) *Server

New initiates a new Server instance and returns it.

func (*Server) Init

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

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

func (*Server) Run

func (s *Server) Run()

Run spins up the router, adds all routes and listens on the provided port. It panics when the router 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

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier