Documentation
¶
Index ¶
- type Option
- type Server
- func (s *Server) IdentityMiddleware() func(http.Handler) http.Handler
- func (s *Server) Router() chi.Router
- func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (s *Server) SetFrontend(webFS fs.FS)
- func (s *Server) SetMCP(mcpSrv *mcpserver.MCPServer, ...)
- func (s *Server) SetTailscale(lc middleware.WhoisClient, us middleware.UserStore)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is a shared HTTP server with routing, identity, and optional frontend serving.
func (*Server) IdentityMiddleware ¶
IdentityMiddleware returns middleware that uses Tailscale identity if configured, otherwise falls back to DevIdentity.
func (*Server) ServeHTTP ¶
func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP implements http.Handler.
func (*Server) SetFrontend ¶
SetFrontend mounts the embedded SPA filesystem. Unmatched routes serve index.html for client-side routing. Hashed assets get long cache; index.html is never cached.
func (*Server) SetMCP ¶
func (s *Server) SetMCP(mcpSrv *mcpserver.MCPServer, userIDInjector func(ctx context.Context, r *http.Request) context.Context)
SetMCP mounts an MCP server at /mcp with identity middleware. userIDInjector is called to inject the user ID into the MCP context.
func (*Server) SetTailscale ¶
func (s *Server) SetTailscale(lc middleware.WhoisClient, us middleware.UserStore)
SetTailscale configures Tailscale identity resolution.
Click to show internal directories.
Click to hide internal directories.