api

package
v0.20.4 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2024 License: AGPL-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 Route

type Route struct {
	Name string
	Func func(resp http.ResponseWriter, req *http.Request)
}

Route defines the path plus handler for a given path

func NewHTTPRoutes

func NewHTTPRoutes(walletExt *walletextension.WalletExtension) []Route

NewHTTPRoutes returns the http specific routes

func NewWSRoutes

func NewWSRoutes(walletExt *walletextension.WalletExtension) []Route

NewWSRoutes returns the WS specific routes

type Server

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

Server is a wrapper for the http server

func NewHTTPServer

func NewHTTPServer(address string, routes []Route) *Server

NewHTTPServer returns the HTTP server for the WE

func NewWSServer

func NewWSServer(address string, routes []Route) *Server

NewWSServer returns the WS server for the WE

func (*Server) Start

func (s *Server) Start() chan error

Start starts the server in its own goroutine and returns an error chan where errors can be monitored

func (*Server) Stop

func (s *Server) Stop() error

Stop synchronously stops the server

Jump to

Keyboard shortcuts

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