Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateResourceHandler ¶
func CreateResourceHandler(handler ResourceHandler, cfg *config.ConfigData) func(ctx context.Context, req mcp.CallToolRequest) (*mcp.CallToolResult, error)
CreateResourceHandler creates an adapter that converts ResourceHandler to the format expected by MCP server
func CreateToolHandler ¶
func CreateToolHandler(executor CommandExecutor, cfg *config.ConfigData) func(ctx context.Context, req mcp.CallToolRequest) (*mcp.CallToolResult, error)
CreateToolHandler creates an adapter that converts CommandExecutor to the format expected by MCP server
Types ¶
type CommandExecutor ¶
type CommandExecutor interface {
Execute(params map[string]interface{}, cfg *config.ConfigData) (string, error)
}
CommandExecutor defines the interface for executing CLI commands This ensures all command executors follow the same pattern and signature
type CommandExecutorFunc ¶
type CommandExecutorFunc func(params map[string]interface{}, cfg *config.ConfigData) (string, error)
CommandExecutorFunc is a function type that implements CommandExecutor This allows regular functions to be used as CommandExecutors without having to create a struct
func (CommandExecutorFunc) Execute ¶
func (f CommandExecutorFunc) Execute(params map[string]interface{}, cfg *config.ConfigData) (string, error)
Execute implements the CommandExecutor interface for CommandExecutorFunc
type ResourceHandler ¶
type ResourceHandler interface {
Handle(params map[string]interface{}, cfg *config.ConfigData) (string, error)
}
ResourceHandler defines the interface for handling Azure SDK-based resource operations This interface is semantically different from CommandExecutor as it handles API calls rather than CLI commands
type ResourceHandlerFunc ¶
type ResourceHandlerFunc func(params map[string]interface{}, cfg *config.ConfigData) (string, error)
ResourceHandlerFunc is a function type that implements ResourceHandler This allows regular functions to be used as ResourceHandlers without having to create a struct
func (ResourceHandlerFunc) Handle ¶
func (f ResourceHandlerFunc) Handle(params map[string]interface{}, cfg *config.ConfigData) (string, error)
Handle implements the ResourceHandler interface for ResourceHandlerFunc