resources

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DocsArticleOverview  = "mcp/overview.md"
	DocsArticleProof     = "mcp/proof.md"
	DocsArticleReference = "mcp/reference.md"
)

Special articles used by this MCP server.

Variables

This section is empty.

Functions

func AccountURI

func AccountURI(name string) string

AccountURI creates a formatted Firebolt account URI for a given account name.

func DatabaseURI

func DatabaseURI(account, database string) string

DatabaseURI creates a formatted Firebolt database URI for a given account and database name.

func DocsURI

func DocsURI(article string) string

DocsURI creates a formatted Firebolt documentation URI for a given article.

func EngineURI

func EngineURI(account, engine string) string

EngineURI creates a formatted Firebolt engine URI for a given account and engine name.

Types

type Accounts

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

Accounts is a resource template handler for serving Firebolt account information. It interacts with the discovery client to retrieve account data from the Firebolt service.

func NewAccounts

func NewAccounts(discoveryClient discovery.Client) *Accounts

NewAccounts creates and returns a new instance of the Accounts resource handler with the provided discovery client.

func (*Accounts) FetchAccountResources

func (r *Accounts) FetchAccountResources(ctx context.Context, accountName string) ([]mcp.ResourceContents, error)

FetchAccountResources retrieves account information from the Firebolt service. If a specific account name is specified, it filters for that account; otherwise, it returns all accounts.

func (*Accounts) Handler

func (r *Accounts) Handler(ctx context.Context, request mcp.ReadResourceRequest) ([]mcp.ResourceContents, error)

Handler processes resource requests for account information. It extracts the account parameter and fetches the appropriate account data.

func (*Accounts) ResourceTemplate

func (r *Accounts) ResourceTemplate() mcp.ResourceTemplate

ResourceTemplate defines the template for account resources. It specifies the URI format, content type, description, and suggested usage.

type Databases

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

Databases is a resource template handler for serving Firebolt database information.

func NewDatabases

func NewDatabases(dbPool database.Pool) *Databases

NewDatabases creates and returns a new instance of the Databases resource handler.

func (*Databases) FetchDatabaseResources

func (r *Databases) FetchDatabaseResources(ctx context.Context, account, dbName string) ([]mcp.ResourceContents, error)

FetchDatabaseResources retrieves database information from the Firebolt service. If a specific database is specified, it filters for that database; otherwise, it returns all databases.

func (*Databases) Handler

func (r *Databases) Handler(ctx context.Context, request mcp.ReadResourceRequest) ([]mcp.ResourceContents, error)

Handler processes resource requests for database information. It extracts account and database parameters and fetches the appropriate database data.

func (*Databases) ResourceTemplate

func (r *Databases) ResourceTemplate() mcp.ResourceTemplate

ResourceTemplate defines the template for database resources. It specifies the URI format, content type, description, and suggested usage.

type Docs

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

Docs is a resource template handler for serving Firebolt documentation articles.

func NewDocs

func NewDocs(docsFS DocsFS, proofSecret string) *Docs

NewDocs creates and returns a new instance of the Docs.

func (*Docs) FetchDocsResources

func (r *Docs) FetchDocsResources(_ context.Context, article string) ([]mcp.ResourceContents, error)

FetchDocsResources retrieves the content for a specified documentation article. It handles special articles (overview, reference) and regular documentation files.

func (*Docs) Handler

func (r *Docs) Handler(ctx context.Context, request mcp.ReadResourceRequest) ([]mcp.ResourceContents, error)

Handler processes resource requests for documentation articles. It extracts the article parameter and fetches the appropriate documentation content.

func (*Docs) ResourceTemplate

func (r *Docs) ResourceTemplate() mcp.ResourceTemplate

ResourceTemplate defines the template for documentation resources. It specifies the URI format, content type, description, and suggested usage.

type DocsFS

type DocsFS interface {
	fs.ReadDirFS
	fs.ReadFileFS
}

DocsFS is an interface that combines the ReadDirFS and ReadFileFS interfaces.

type Engines

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

Engines is a resource template handler for serving Firebolt engine information.

func NewEngines

func NewEngines(dbPool database.Pool) *Engines

NewEngines creates and returns a new instance of the Engines resource handler.

func (*Engines) FetchEngineResources

func (r *Engines) FetchEngineResources(ctx context.Context, account, engine string) ([]mcp.ResourceContents, error)

FetchEngineResources retrieves engine information from the database. If a specific engine is specified, it filters for that engine; otherwise, it returns all engines.

func (*Engines) Handler

func (r *Engines) Handler(ctx context.Context, request mcp.ReadResourceRequest) ([]mcp.ResourceContents, error)

Handler processes resource requests for engine information. It extracts account and engine parameters and fetches the appropriate engine data.

func (*Engines) ResourceTemplate

func (r *Engines) ResourceTemplate() mcp.ResourceTemplate

ResourceTemplate defines the template for engine resources. It specifies the URI format, content type, description, and suggested usage.

Jump to

Keyboard shortcuts

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