Documentation
¶
Overview ¶
Package api provides HTTP server and API documentation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SwaggerUIHTML ¶
SwaggerUIHTML returns the HTML template for Swagger UI.
Types ¶
type APIServer ¶
type APIServer struct {
// contains filtered or unexported fields
}
APIServer provides an HTTP API backed by a kodit Client.
func NewAPIServer ¶
NewAPIServer creates a new APIServer wired to the given kodit Client. apiKeys configures write-protection: mutating endpoints (POST, PUT, PATCH, DELETE) on /api/v1/repositories and /api/v1/enrichments require a valid key. Read-only endpoints, search, MCP, and docs remain open.
func (*APIServer) DocsRouter ¶
func (a *APIServer) DocsRouter(specURL string) *DocsRouter
DocsRouter returns a router for Swagger UI and OpenAPI spec.
func (*APIServer) Handler ¶
Handler returns the router as an http.Handler for use with custom servers.
func (*APIServer) ListenAndServe ¶
ListenAndServe starts the HTTP server on the given address.
func (*APIServer) MountRoutes ¶
func (a *APIServer) MountRoutes()
MountRoutes wires up all v1 API routes on the router. Call this after adding any custom middleware via Router().Use().
type DocsRouter ¶
type DocsRouter struct {
// contains filtered or unexported fields
}
DocsRouter sets up documentation routes.
func NewDocsRouter ¶
func NewDocsRouter(specURL string) *DocsRouter
NewDocsRouter creates a new documentation router.
func (*DocsRouter) Routes ¶
func (d *DocsRouter) Routes() chi.Router
Routes returns the chi router for documentation endpoints.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server represents the HTTP API server.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package jsonapi provides JSON:API specification compliant types for API responses.
|
Package jsonapi provides JSON:API specification compliant types for API responses. |
|
Package middleware provides HTTP middleware for the API server.
|
Package middleware provides HTTP middleware for the API server. |
|
Package v1 provides the v1 API routes.
|
Package v1 provides the v1 API routes. |
|
dto
Package dto provides data transfer objects for the API layer.
|
Package dto provides data transfer objects for the API layer. |