web

package
v0.2.30 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2026 License: MPL-2.0 Imports: 29 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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) MountDAV added in v0.2.26

func (web *WebController) MountDAV(wellKnown, prefix string, h http.Handler)

MountDAV mounts a DAV personality's handler on prefix (no trailing slash) and on its well-known path. Call before Start. The handler answers from its own store and never runs a stack for a read; it bypasses the operator BasicAuth wrapper (it has its own account-table Basic auth) exactly as the AI gateway does. Two mounts must not share a prefix (app.go refuses to start when they do).

func (*WebController) SetCalendar added in v0.2.26

func (web *WebController) SetCalendar(h http.Handler, prefix string)

SetCalendar mounts the calendar personality's handler on prefix and on /.well-known/caldav (MountDAV with the CalDAV well-known path).

func (*WebController) SetLLMGateway added in v0.2.21

func (web *WebController) SetLLMGateway(messages, countTokens http.HandlerFunc)

SetLLMGateway wires the AI-gateway inlet's handlers onto POST /v1/messages (stack-processed) and /v1/messages/count_tokens (stackless transparent forward). Call before Start.

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) SetWebSocket added in v0.2.26

func (web *WebController) SetWebSocket(c *websocketp.Controller)

SetWebSocket wires the websocket personality's controller into the web head. Call before Start. Inert unless the controller is enabled.

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