web

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2026 License: MPL-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LogEntry

type LogEntry struct {
	Host        string
	UserIp      string
	Method      string
	URL         string
	Status      int
	Size        int
	UserAgent   string
	RequestTime int
	Rid         string
}

type WebController

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

func NewController

func NewController(ctx context.Context, pu *processor.Unit, sink trace.Sink) *WebController

func (*WebController) BasicAuth

func (web *WebController) BasicAuth(handler http.HandlerFunc, username, password, realm string) http.HandlerFunc

BasicAuth wraps a handler requiring HTTP basic auth for it using the given username and password and the specified realm, which shouldn't contain quotes.

Most web browser display a dialog with something like:

The website says: "<realm>"

Which is really stupid so you may want to set the realm to a message rather than an actual realm.

func (*WebController) CtxMiddleware

func (web *WebController) CtxMiddleware(next http.Handler) http.Handler

add ctx to pass things to logging

func (*WebController) Log

func (web *WebController) Log(entry LogEntry)

func (*WebController) LogFromRequest

func (web *WebController) LogFromRequest(crw *contextResponseWriter, r *http.Request, rt int)

func (*WebController) LoggingMiddleware

func (web *WebController) LoggingMiddleware(next http.Handler) http.Handler

simple logging

func (*WebController) SetTLSConfig added in v0.2.4

func (web *WebController) SetTLSConfig(c *tls.Config)

SetTLSConfig wires the bundled cert manager's TLS config into the web head, enabling the HTTPS listener. Call before Start. No-op effect unless --web-tls-addr is also set.

func (*WebController) Start

func (web *WebController) Start()

func (*WebController) Stop

func (web *WebController) Stop()

Jump to

Keyboard shortcuts

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