cmd

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2025 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Config is the global configuration instance
	Config AppConfig

	// ConfigFile is the path to the configuration file
	ConfigFile string
)
View Source
var (
	// Logger is the global logger instance
	Logger *zap.SugaredLogger
)

Functions

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

func ExportDefaultConfig

func ExportDefaultConfig(path string) error

ExportDefaultConfig writes a default configuration file to the specified path

func WriteConfigFile

func WriteConfigFile(path string) error

WriteConfigFile writes the current configuration to a file

Types

type APISpec

type APISpec struct {
	URL  string      `json:"url"`
	Spec *openapi3.T `json:"spec"`
}

APISpec represents an OpenAPI specification

type AppConfig

type AppConfig struct {
	Logging struct {
		Level  string `mapstructure:"level"`
		Format string `mapstructure:"format"`
	} `mapstructure:"logging"`

	Server struct {
		Port     int    `mapstructure:"port"`
		SpecsDir string `mapstructure:"specs_dir"`
	} `mapstructure:"server"`

	GitHub struct {
		Token string `mapstructure:"token"`
	} `mapstructure:"github"`

	Specs []string `mapstructure:"specs"`
}

AppConfig is the main application configuration structure

type MCPHandler

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

MCPHandler handles OpenAPI specs and MCP requests

func NewMCPHandler

func NewMCPHandler() *MCPHandler

NewMCPHandler creates a new MCPHandler

func (*MCPHandler) GetSpec

func (h *MCPHandler) GetSpec(w http.ResponseWriter, r *http.Request)

GetSpec gets a registered OpenAPI specification

func (*MCPHandler) ListEndpoints

func (h *MCPHandler) ListEndpoints(w http.ResponseWriter, r *http.Request)

ListEndpoints lists all endpoints in a registered OpenAPI specification

func (*MCPHandler) RegisterSpec

func (h *MCPHandler) RegisterSpec(w http.ResponseWriter, r *http.Request)

RegisterSpec registers a new OpenAPI specification

type MCPRequest

type MCPRequest struct {
	Query string `json:"query"`
}

MCPRequest represents a request to the MCP server

type MCPResponse

type MCPResponse struct {
	Context string `json:"context"`
}

MCPResponse represents a response from the MCP server

Jump to

Keyboard shortcuts

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