server

package
v0.0.0-...-52f154f Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterHandlers

func RegisterHandlers(router EchoRouter, si ServerInterface, m ...echo.MiddlewareFunc)

RegisterHandlers register the handlers

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
}

EchoRouter 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 Hotwire

type Hotwire struct{}

Hotwire hotwire handlers which demonstate some of the capabilities

func NewHotwire

func NewHotwire() *Hotwire

NewHotwire new hotwire handlers

func (*Hotwire) Greeting

func (hw *Hotwire) Greeting(c echo.Context) error

Greeting process greetings using a query parameter

func (*Hotwire) Index

func (hw *Hotwire) Index(c echo.Context) error

Index using a template build the index page

func (*Hotwire) Load

func (hw *Hotwire) Load(c echo.Context) error

Load use http2 server sent events to stream load information

func (*Hotwire) Memory

func (hw *Hotwire) Memory(c echo.Context) error

Memory uses websockets

func (*Hotwire) Pinger

func (hw *Hotwire) Pinger(c echo.Context) error

Pinger process form POSTs which are either returned as a partial or full page dependending on the media type

type ServerInterface

type ServerInterface interface {
	Index(echo.Context) error
	Greeting(echo.Context) error
	Pinger(echo.Context) error
	Memory(echo.Context) error
	Load(echo.Context) error
}

ServerInterface implemented by the handlers

Jump to

Keyboard shortcuts

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