handler

package
v0.0.0-...-31a6bf9 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2022 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	Counter          counter.Counter
	LocalCache       *cache.Cache
	AsyncTask        task.Keeper
	WebSocketBreaker websocket.Breaker
	IndexTemplate    *template.Template
	Badge            badge.Writer
	Icons            map[string]badge.Icon
	IconsList        []map[string]string
}

func NewHandler

func NewHandler(redisAddr string) (*Handler, error)

NewHandler creates handler object.

func (*Handler) Error

func (h *Handler) Error(err error, c echo.Context)

Error is API for error.

func (*Handler) HealthCheck

func (h *Handler) HealthCheck(c echo.Context) error

HealthCheck is API for checking server status.

func (*Handler) Icon

func (h *Handler) Icon(c echo.Context) error

Icon returns icon.svg

func (*Handler) IconAll

func (h *Handler) IconAll(c echo.Context) error

IconAll returns icon list.

func (*Handler) Index

func (h *Handler) Index(c echo.Context) error

Index is API for main page.

func (*Handler) Wasm

func (h *Handler) Wasm(c echo.Context) error

Wasm is API for serving wasm file.

func (*Handler) WebSocket

func (h *Handler) WebSocket(c echo.Context) error

WebSocket is API for websocket.

type HitCounterContext

type HitCounterContext struct {
	echo.Context
}

It's custom context.

func (*HitCounterContext) ExtraLog

func (c *HitCounterContext) ExtraLog() map[string]interface{}

ExtraLog returns log struct.

func (*HitCounterContext) GetContext

func (c *HitCounterContext) GetContext() context.Context

GetContext returns a context in request.

func (*HitCounterContext) SetContext

func (c *HitCounterContext) SetContext(ctx context.Context)

SetContext sets a context to request.

func (*HitCounterContext) ValueContext

func (c *HitCounterContext) ValueContext(key interface{}) interface{}

ValueContext returns values in request context.

func (*HitCounterContext) WithContext

func (c *HitCounterContext) WithContext(key, val interface{})

WithContext set a context with new value to request.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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