aws

package
v0.40.5 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2025 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsHTMLContent

func IsHTMLContent(content, contentType string) bool

IsHTMLContent determines if the content is HTML based on content type and content

Types

type AWSDocumentationTool

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

AWSDocumentationTool implements the unified AWS documentation functionality

func (*AWSDocumentationTool) Definition

func (t *AWSDocumentationTool) Definition() mcp.Tool

Definition returns the AWS documentation tool's definition for MCP registration

func (*AWSDocumentationTool) Execute

func (t *AWSDocumentationTool) Execute(ctx context.Context, logger *logrus.Logger, cache *sync.Map, args map[string]any) (*mcp.CallToolResult, error)

Execute performs the specified action on AWS documentation

func (*AWSDocumentationTool) ProvideExtendedInfo

func (t *AWSDocumentationTool) ProvideExtendedInfo() *tools.ExtendedHelp

ProvideExtendedInfo implements the ExtendedHelpProvider interface for the AWS documentation tool

type Client

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

Client handles HTTP operations for AWS documentation API

func NewClient

func NewClient(logger *logrus.Logger) *Client

NewClient creates a new AWS documentation API client with proxy support

func (*Client) FetchDocumentation

func (c *Client) FetchDocumentation(url string) (string, error)

FetchDocumentation fetches AWS documentation content from a URL

func (*Client) GetRecommendations

func (c *Client) GetRecommendations(url string) ([]RecommendationResult, error)

GetRecommendations gets content recommendations for an AWS documentation URL

func (*Client) SearchDocumentation

func (c *Client) SearchDocumentation(query string, limit int) ([]SearchResult, error)

SearchDocumentation searches AWS documentation using the search API

type DocumentationResponse

type DocumentationResponse struct {
	URL            string `json:"url"`
	Content        string `json:"content"`
	TotalLength    int    `json:"total_length"`
	StartIndex     int    `json:"start_index"`
	EndIndex       int    `json:"end_index"`
	HasMoreContent bool   `json:"has_more_content"`
	NextStartIndex *int   `json:"next_start_index,omitempty"`
}

DocumentationResponse represents a documentation reading response with pagination info

type Parser

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

Parser handles HTML parsing and markdown conversion for AWS documentation

func NewParser

func NewParser() *Parser

NewParser creates a new HTML parser for AWS documentation

func (*Parser) ConvertHTMLToMarkdown

func (p *Parser) ConvertHTMLToMarkdown(htmlContent string) (string, error)

ConvertHTMLToMarkdown converts AWS documentation HTML to clean markdown

func (*Parser) FormatDocumentationResult

func (p *Parser) FormatDocumentationResult(url, content string, startIndex, maxLength int) DocumentationResponse

FormatDocumentationResult formats the documentation content with pagination information

type RecommendationAPIResponse

type RecommendationAPIResponse struct {
	HighlyRated struct {
		Items []struct {
			URL        string `json:"url"`
			AssetTitle string `json:"assetTitle"`
			Abstract   string `json:"abstract"`
		} `json:"items"`
	} `json:"highlyRated"`
	Journey struct {
		Items []struct {
			Intent string `json:"intent"`
			URLs   []struct {
				URL        string `json:"url"`
				AssetTitle string `json:"assetTitle"`
			} `json:"urls"`
		} `json:"items"`
	} `json:"journey"`
	New struct {
		Items []struct {
			URL         string `json:"url"`
			AssetTitle  string `json:"assetTitle"`
			DateCreated string `json:"dateCreated"`
		} `json:"items"`
	} `json:"new"`
	Similar struct {
		Items []struct {
			URL        string `json:"url"`
			AssetTitle string `json:"assetTitle"`
			Abstract   string `json:"abstract"`
		} `json:"items"`
	} `json:"similar"`
}

RecommendationAPIResponse represents the response structure from AWS recommendations API

type RecommendationResult

type RecommendationResult struct {
	URL     string  `json:"url"`
	Title   string  `json:"title"`
	Context *string `json:"context,omitempty"`
}

RecommendationResult represents a recommendation result from AWS documentation

type SearchAPIRequest

type SearchAPIRequest struct {
	TextQuery struct {
		Input string `json:"input"`
	} `json:"textQuery"`
	ContextAttributes []struct {
		Key   string `json:"key"`
		Value string `json:"value"`
	} `json:"contextAttributes"`
	AcceptSuggestionBody string   `json:"acceptSuggestionBody"`
	Locales              []string `json:"locales"`
}

SearchAPIRequest represents the request structure for AWS documentation search API

type SearchAPIResponse

type SearchAPIResponse struct {
	Suggestions []struct {
		TextExcerptSuggestion struct {
			Link           string `json:"link"`
			Title          string `json:"title"`
			Summary        string `json:"summary"`
			SuggestionBody string `json:"suggestionBody"`
		} `json:"textExcerptSuggestion"`
	} `json:"suggestions"`
}

SearchAPIResponse represents the response structure from AWS documentation search API

type SearchResult

type SearchResult struct {
	RankOrder int     `json:"rank_order"`
	URL       string  `json:"url"`
	Title     string  `json:"title"`
	Context   *string `json:"context,omitempty"`
}

SearchResult represents a search result from AWS documentation search API

Jump to

Keyboard shortcuts

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