Documentation
¶
Overview ¶
Package api provides the extensible HTTP Admin API server.
Index ¶
- type Dependencies
- type ProtectedHandlerFunc
- type Server
- func (s *Server) Handle(pattern string, handler http.Handler)
- func (s *Server) HandleFunc(pattern string, handler http.HandlerFunc)
- func (s *Server) HandleProtected(pattern, permission string, handler ProtectedHandlerFunc)
- func (s *Server) Listen(addr string) error
- func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dependencies ¶
type Dependencies struct {
Store storage.Store
Plugins *plugin.Registry
Users storage.UserRepository
Chats storage.ChatRepository
Events observability.EventLogStore
Audits observability.AuditLogStore
Metrics observability.MetricsStore
Auth auth.Verifier
}
Dependencies configures system repositories, observability and authentication.
type ProtectedHandlerFunc ¶ added in v1.0.2
ProtectedHandlerFunc handles an authorized request with verified claims.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server serves built-in system endpoints and application-defined routes.
func NewWithDependencies ¶
func NewWithDependencies(deps Dependencies) *Server
NewWithDependencies creates a server and derives repositories from Store when set.
func NewWithPlugins ¶
NewWithPlugins creates a server backed by a plugin registry.
func (*Server) Handle ¶ added in v1.0.2
Handle registers an application route using net/http ServeMux patterns.
func (*Server) HandleFunc ¶ added in v1.0.2
func (s *Server) HandleFunc(pattern string, handler http.HandlerFunc)
HandleFunc registers an application handler using net/http ServeMux patterns.
func (*Server) HandleProtected ¶ added in v1.0.2
func (s *Server) HandleProtected(pattern, permission string, handler ProtectedHandlerFunc)
HandleProtected registers a route guarded by the configured verifier and permission.