webserver

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type WebServer

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

WebServer main web service (handler)

func New

func New(config *config.Config, auth *config.Auth, logger *zap.Logger) (*WebServer, error)

New create a new Webserver instance

func (*WebServer) Auth

func (s *WebServer) Auth(ctx *fasthttp.RequestCtx) (*config.APIKey, error)

Auth check authentication first TODO: can that be a lightweight middleware please?

func (*WebServer) Close

func (s *WebServer) Close() error

Close sends `stop` signal to fasthttp server

func (*WebServer) Cors

func (s *WebServer) Cors(ctx *fasthttp.RequestCtx)

Cors respond an OPTIONS request (main auth)

func (*WebServer) NodeList

func (s *WebServer) NodeList(ctx *fasthttp.RequestCtx)

NodeList list the nodes and general availability

func (*WebServer) NotFound

func (s *WebServer) NotFound(ctx *fasthttp.RequestCtx)

NotFound url handler, can't we handle all here?

func (*WebServer) Proxy

func (s *WebServer) Proxy(ctx *fasthttp.RequestCtx)

Proxy process the actual request

func (*WebServer) Run

func (s *WebServer) Run() error

Run starts server

func (*WebServer) StartHealthChecker

func (s *WebServer) StartHealthChecker()

StartHealthChecker starts the health check cron

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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