httpserver

package module
v0.0.0-...-85add97 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: AGPL-3.0 Imports: 15 Imported by: 23

README

Http Server

wrapper for the base http server implementation, used for periMICA base and container. It handles security, access control (RBAC).

Dual License

This software is by default licensed via the GNU Affero General Public License version 3. However it is also available with a commercial license on request (https://perinet.io/contact).

Documentation

Overview

Perinets http server wrapper implementation usable for periMICA containers

Index

Constants

View Source
const (
	GET    = "GET"
	POST   = "POST"
	PATCH  = "PATCH"
	PUT    = "PUT"
	DELETE = "DELETE"
	HEAD   = "HEAD"
	SSE    = "SSE"
)

Variables

Functions

func AddEndpoints

func AddEndpoints(end []Endpoint)

func AddPaths

func AddPaths(end []PathInfo)

func AddRouter

func AddRouter(handler roleHandlerType) *mux.Router

func HttpRedirect

func HttpRedirect(listenAddress string, redirectPort uint16)

func ListenAndServe

func ListenAndServe(listenAddress string)

func Restart

func Restart()

func SendSSE

func SendSSE[T []byte | string](path string, message T)

func SetCertificates

func SetCertificates(certs Certificates)

func Shutdown

func Shutdown()

Types

type Certificates

type Certificates struct {
	CaCert      []byte
	HostCert    []byte
	HostCertKey []byte
}

type Endpoint

type Endpoint = PathInfo

DEPRECATED transitional aliases

type PathInfo

type PathInfo struct {
	Url         string
	UrlIsPrefix bool
	Method      string
	Role        rbac.Role
	Call        func(w http.ResponseWriter, r *http.Request)
}

Directories

Path Synopsis
role based access control
role based access control

Jump to

Keyboard shortcuts

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