swagger

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 2, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package swagger provides a Swagger UI server for displaying OpenAPI specifications

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIMetadata

type APIMetadata struct {
	Name           string   `json:"name"`           // API name
	URL            string   `json:"url"`            // URL to fetch the OpenAPI spec
	Title          string   `json:"title"`          // Display title
	Version        string   `json:"version"`        // API version
	Description    string   `json:"description"`    // API description
	ResourceType   string   `json:"resourceType"`   // Type of resource (e.g., Service, Deployment)
	ResourceName   string   `json:"resourceName"`   // Name of the Kubernetes resource
	Namespace      string   `json:"namespace"`      // Kubernetes namespace
	LastUpdated    string   `json:"lastUpdated"`    // Last update timestamp
	AllowedMethods []string `json:"allowedMethods"` // Allowed HTTP methods for Swagger UI
}

APIMetadata represents metadata about an OpenAPI specification

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server serves the Swagger UI and aggregated OpenAPI specs

func NewServer

func NewServer() *Server

NewServer creates a new Swagger UI server

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*Server) Start

func (s *Server) Start(port int) error

Start starts the Swagger UI server

func (*Server) UpdateSpecs

func (s *Server) UpdateSpecs(apis []observabilityv1alpha1.APIInfo)

UpdateSpecs updates the stored OpenAPI specs based on the current status

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL