Documentation
¶
Index ¶
- type LogEntry
- type WebController
- func (web *WebController) BasicAuth(handler http.HandlerFunc, username, password, realm string) http.HandlerFunc
- func (web *WebController) CtxMiddleware(next http.Handler) http.Handler
- func (web *WebController) Log(entry LogEntry)
- func (web *WebController) LogFromRequest(crw *contextResponseWriter, r *http.Request, rt int)
- func (web *WebController) LoggingMiddleware(next http.Handler) http.Handler
- func (web *WebController) MountDAV(wellKnown, prefix string, h http.Handler)
- func (web *WebController) SetCalendar(h http.Handler, prefix string)
- func (web *WebController) SetLLMGateway(messages, countTokens http.HandlerFunc)
- func (web *WebController) SetTLSConfig(c *tls.Config)
- func (web *WebController) SetWebSocket(c *websocketp.Controller)
- func (web *WebController) Start()
- func (web *WebController) Stop()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type WebController ¶
type WebController struct {
// contains filtered or unexported fields
}
func NewController ¶
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()