server

package
v0.0.0-...-8acb9dd Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2021 License: GPL-3.0 Imports: 39 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// WebsocketInstructionAck Code used to acknowledge a previous message
	WebsocketInstructionAck websocketInstruction = 0
	// WebsocketInstructionHello Code used to send a healthcheck keepalive
	WebsocketInstructionHello websocketInstruction = 1
	// WebsocketInstructionTriggerUpdate Code received to trigger a config update
	WebsocketInstructionTriggerUpdate websocketInstruction = 2
)
View Source
const ConfigErrorReportingEnabled = "error_reporting_enabled"
View Source
const ConfigErrorReportingEnvironment = "error_reporting_environment"
View Source
const ConfigLogLevel = "log_level"

Variables

This section is empty.

Functions

func LoggingHandler

func LoggingHandler(h http.Handler) http.Handler

LoggingHandler provides an http.Handler which logs requests to the HTTP server

func SetUserAgent

func SetUserAgent(inner http.RoundTripper, userAgent string) http.RoundTripper

Types

type APIController

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

APIController main controller which connects to the authentik api via http and ws

func NewAPIController

func NewAPIController(pbURL url.URL, token string) *APIController

NewAPIController initialise new API Controller instance from URL and API token

func (*APIController) Shutdown

func (ac *APIController) Shutdown()

Shutdown Gracefully stops all workers, disconnects from websocket

func (*APIController) Start

func (a *APIController) Start() error

Start Starts all handlers, non-blocking

func (*APIController) UpdateIfRequired

func (a *APIController) UpdateIfRequired() error

UpdateIfRequired Updates the HTTP Server config if required, automatically swaps the handlers

type Server

type Server struct {
	Handlers map[string]*providerBundle
	// contains filtered or unexported fields
}

Server represents an HTTP server

func NewServer

func NewServer() *Server

NewServer initialise a new HTTP Server

func (*Server) ServeHTTP

func (s *Server) ServeHTTP()

ServeHTTP constructs a net.Listener and starts handling HTTP requests

func (*Server) ServeHTTPS

func (s *Server) ServeHTTPS()

ServeHTTPS constructs a net.Listener and starts handling HTTPS requests

Jump to

Keyboard shortcuts

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