Documentation
¶
Index ¶
- func Base64Encode(input string) string
- func ContainsStatusCode(codes []int, statusCode int) bool
- func ExtractParams(request mcp.CallToolRequest, params_list []string) map[string]string
- func FormatCywareToken(rawToken string) string
- func GenerateAuthParams(accessID, secretKey string) map[string]string
- func GetDomain(baseURL string) string
- func GetRestyClient(retryHook func(r *resty.Response, err error)) *resty.Client
- func JsonifyResponse(obj any) any
- func MCPToolResponse(resp *APIResponse, expected_status_code []int, err error) (*mcp.CallToolResult, error)
- type APIClient
- type APIResponse
- type Application
- type Auth
- type Config
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Base64Encode ¶
Base64Encode encodes the input string to Base64 format
func ContainsStatusCode ¶
func ExtractParams ¶
func ExtractParams(request mcp.CallToolRequest, params_list []string) map[string]string
ExtractParams extracts params key from the tool call request and convert them into a map
func FormatCywareToken ¶
func GenerateAuthParams ¶
GenerateAuthParams generates authentication parameters
func GetDomain ¶
GetDomain extracts and returns the scheme and host (i.e., domain) from the given base URL. For example, "https://example.com/api" -> "https://example.com".
func GetRestyClient ¶
func JsonifyResponse ¶
func MCPToolResponse ¶
func MCPToolResponse(resp *APIResponse, expected_status_code []int, err error) (*mcp.CallToolResult, error)
Types ¶
type APIResponse ¶
type Application ¶
type Application struct {
BASE_URL string `mapstructure:"base_url"`
Auth Auth `mapstructure:"auth"`
}
Application defines the configuration for an external application, including its base URL and authentication credentials.
type Auth ¶
type Auth struct {
Type string `mapstructure:"type"`
Username string `mapstructure:"username,omitempty"`
Password string `mapstructure:"password,omitempty"`
Token string `mapstructure:"token,omitempty"`
AccessID string `mapstructure:"access_id,omitempty"`
SecretKey string `mapstructure:"secret_key,omitempty"`
}
Auth defines the authentication configuration for an application. It supports different auth types like "basic", "token".
type Config ¶
type Config struct {
Applications map[string]Application `mapstructure:"applications"`
Server Server `mapstructure:"server"`
}
Config holds the top-level configuration structure loaded from a YAML file. It includes all application definitions and the server settings.