web

package
v0.2.21 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2026 License: MPL-2.0 Imports: 27 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) 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) 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