tools

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2025 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearCache

func ClearCache()

ClearCache removes all cached entries (useful for testing)

func CreateAPIService

func CreateAPIService(ctx context.Context, req *mcp.CallToolRequest, params CreateAPIServiceParams) (*mcp.CallToolResult, any, error)

CreateAPIService creates a new go-zero API service

func GenerateAPIFromSpec

func GenerateAPIFromSpec(ctx context.Context, req *mcp.CallToolRequest, params GenerateAPIFromSpecParams) (*mcp.CallToolResult, any, error)

GenerateAPIFromSpec generates go-zero API code from API specification file (T044-T046)

func GenerateConfigTemplate

func GenerateConfigTemplate(ctx context.Context, req *mcp.CallToolRequest, params GenerateConfigParams) (*mcp.CallToolResult, any, error)

GenerateConfigTemplate generates a configuration file template

func GenerateTemplate

func GenerateTemplate(ctx context.Context, req *mcp.CallToolRequest, params GenerateTemplateParams) (*mcp.CallToolResult, any, error)

GenerateTemplate generates code templates for common patterns

func GetCacheStats

func GetCacheStats() map[string]interface{}

GetCacheStats returns cache statistics for monitoring

func QueryDocs

func QueryDocs(ctx context.Context, req *mcp.CallToolRequest, params QueryDocsParams) (*mcp.CallToolResult, any, error)

QueryDocs queries go-zero framework documentation and migration guides

func ValidateConfig

func ValidateConfig(ctx context.Context, req *mcp.CallToolRequest, params ValidateConfigParams) (*mcp.CallToolResult, any, error)

ValidateConfig validates a go-zero configuration file

Types

type AnalyzeProjectParams

type AnalyzeProjectParams struct {
	ProjectPath string `json:"project_path"`
}

type CreateAPIServiceParams

type CreateAPIServiceParams struct {
	ServiceName string `json:"service_name"`
	Port        int    `json:"port,omitempty"`
	OutputDir   string `json:"output_dir,omitempty"`
	Style       string `json:"style,omitempty"`
}

CreateAPIServiceParams defines the parameters for creating an API service

type CreateAPISpecParams

type CreateAPISpecParams struct {
	ServiceName   string `json:"service_name"`
	EndpointsJSON string `json:"endpoints_json"`
	OutputPath    string `json:"output_path,omitempty"`
}

type CreateRPCServiceParams

type CreateRPCServiceParams struct {
	ServiceName  string `json:"service_name"`
	ProtoContent string `json:"proto_content"`
	OutputDir    string `json:"output_dir,omitempty"`
	Style        string `json:"style,omitempty"`
}

type EndpointInput

type EndpointInput struct {
	Method   string                 `json:"method"`
	Path     string                 `json:"path"`
	Handler  string                 `json:"handler"`
	Request  map[string]interface{} `json:"request,omitempty"`
	Response map[string]interface{} `json:"response,omitempty"`
}

type GenerateAPIFromSpecParams

type GenerateAPIFromSpecParams struct {
	APIFile   string `json:"api_file"`
	OutputDir string `json:"output_dir,omitempty"`
	Style     string `json:"style,omitempty"`
}

GenerateAPIFromSpecParams defines the parameters for generate_api_from_spec tool (T040-T043)

type GenerateConfigParams

type GenerateConfigParams struct {
	ServiceName string `json:"service_name"`
	ServiceType string `json:"service_type"` // "api" or "rpc"
	Environment string `json:"environment"`  // "development", "production", "test"
	Port        int    `json:"port,omitempty"`
	OutputPath  string `json:"output_path,omitempty"`
}

type GenerateModelParams

type GenerateModelParams struct {
	SourceType string `json:"source_type"`
	Source     string `json:"source"`
	Table      string `json:"table"`
	OutputDir  string `json:"output_dir,omitempty"`
	Style      string `json:"style,omitempty"`
}

type GenerateTemplateParams

type GenerateTemplateParams struct {
	TemplateType string `json:"template_type"`        // "middleware", "error_handler", "deployment"
	TemplateName string `json:"template_name"`        // specific template like "auth", "logging", etc.
	Parameters   string `json:"parameters,omitempty"` // JSON string of parameters
	OutputPath   string `json:"output_path,omitempty"`
}

type QueryDocsParams

type QueryDocsParams struct {
	Query string `json:"query"` // The documentation query
}

type ValidateConfigParams

type ValidateConfigParams struct {
	ConfigPath  string `json:"config_path"`
	ServiceType string `json:"service_type,omitempty"` // "api" or "rpc"
}

Jump to

Keyboard shortcuts

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