Documentation
¶
Index ¶
- func New() ports.DocsManager
- func NewWithConfig(config ports.DocsConfig) ports.DocsManager
- type Handler
- func (h *Handler) HTMLHandler(w http.ResponseWriter, r *http.Request)
- func (h *Handler) InfoHandler(w http.ResponseWriter, r *http.Request)
- func (h *Handler) Middleware() func(http.Handler) http.Handler
- func (h *Handler) OpenAPIHandler(w http.ResponseWriter, r *http.Request)
- func (h *Handler) RegisterCustomRoutes(router interface{ ... }, paths ports.DocsPaths)
- func (h *Handler) RegisterRoutes(router interface{ ... })
- func (h *Handler) VersionHandler(w http.ResponseWriter, r *http.Request)
- type Manager
- func (m *Manager) GetHTML() (string, error)
- func (m *Manager) GetInfo() ports.DocsInfo
- func (m *Manager) GetOpenAPI() ([]byte, error)
- func (m *Manager) GetVersion() (string, error)
- func (m *Manager) RegisterProvider(provider ports.DocsProvider)
- func (m *Manager) ServeHTML(w http.ResponseWriter, r *http.Request)
- func (m *Manager) ServeInfo(w http.ResponseWriter, r *http.Request)
- func (m *Manager) ServeOpenAPI(w http.ResponseWriter, r *http.Request)
- func (m *Manager) ServeVersion(w http.ResponseWriter, r *http.Request)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewWithConfig ¶
func NewWithConfig(config ports.DocsConfig) ports.DocsManager
NewWithConfig creates a new docs manager with custom configuration.
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler provides HTTP handlers for documentation endpoints.
func NewDefaultHandler ¶
func NewDefaultHandler() *Handler
NewDefaultHandler builds a handler using the default docs manager.
func NewHandler ¶
func NewHandler(manager ports.DocsManager) *Handler
NewHandler creates a new docs handler.
func (*Handler) HTMLHandler ¶
func (h *Handler) HTMLHandler(w http.ResponseWriter, r *http.Request)
HTMLHandler handles HTML documentation requests. @Summary API Documentation @Description Returns the API documentation page @Tags docs @Accept html @Produce html @Success 200 {string} string "HTML documentation page" @Router /docs [get]
func (*Handler) InfoHandler ¶
func (h *Handler) InfoHandler(w http.ResponseWriter, r *http.Request)
InfoHandler handles info requests.
func (*Handler) Middleware ¶
Middleware creates a middleware that adds documentation information to requests.
func (*Handler) OpenAPIHandler ¶
func (h *Handler) OpenAPIHandler(w http.ResponseWriter, r *http.Request)
OpenAPIHandler handles OpenAPI specification requests. @Summary OpenAPI Specification @Description Returns the OpenAPI specification in JSON format @Tags docs @Accept json @Produce json @Success 200 {object} map[string]interface{} "OpenAPI specification" @Failure 404 {object} map[string]interface{} "OpenAPI specification not found" @Router /docs/openapi.json [get]
func (*Handler) RegisterCustomRoutes ¶
func (h *Handler) RegisterCustomRoutes(router interface { Get(pattern string, h http.HandlerFunc) }, paths ports.DocsPaths)
RegisterCustomRoutes registers documentation endpoints with custom paths.
func (*Handler) RegisterRoutes ¶
func (h *Handler) RegisterRoutes(router interface { Get(pattern string, h http.HandlerFunc) })
RegisterRoutes registers all documentation endpoints on the given router.
func (*Handler) VersionHandler ¶
func (h *Handler) VersionHandler(w http.ResponseWriter, r *http.Request)
VersionHandler handles version requests.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager implements ports.DocsManager for managing documentation.
func (*Manager) GetOpenAPI ¶
GetOpenAPI returns the OpenAPI specification.
func (*Manager) GetVersion ¶
GetVersion returns the API version.
func (*Manager) RegisterProvider ¶
func (m *Manager) RegisterProvider(provider ports.DocsProvider)
RegisterProvider registers a documentation provider.
func (*Manager) ServeHTML ¶
func (m *Manager) ServeHTML(w http.ResponseWriter, r *http.Request)
ServeHTML serves the HTML documentation.
func (*Manager) ServeInfo ¶
func (m *Manager) ServeInfo(w http.ResponseWriter, r *http.Request)
ServeInfo serves the documentation info.
func (*Manager) ServeOpenAPI ¶
func (m *Manager) ServeOpenAPI(w http.ResponseWriter, r *http.Request)
ServeOpenAPI serves the OpenAPI specification.
func (*Manager) ServeVersion ¶
func (m *Manager) ServeVersion(w http.ResponseWriter, r *http.Request)
ServeVersion serves the API version.