resources

package
v1.11.1 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2026 License: Apache-2.0 Imports: 8 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LogsResource

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

LogsResource handles logs as MCP resources

func NewLogsResource

func NewLogsResource(client client.Client) *LogsResource

NewLogsResource creates a new logs resource

func (*LogsResource) Definition

func (r *LogsResource) Definition() ResourceDefinition

Definition returns the resource template definition for MCP

func (*LogsResource) GetContent

func (r *LogsResource) GetContent(ctx context.Context, uri string) (io.Reader, string, error)

GetContent returns a reader for the logs

func (*LogsResource) GetResourceTemplate

func (r *LogsResource) GetResourceTemplate() ResourceTemplate

GetResourceTemplate returns the template definition for listing resources

func (*LogsResource) IsAvailable

func (r *LogsResource) IsAvailable(ctx context.Context, uri string) bool

IsAvailable checks if the resource is available at the given URI

type Resource

type Resource interface {
	Definition() ResourceDefinition
	GetContent(ctx context.Context, uri string) (io.Reader, string, error) // Returns reader, mimeType, error
	IsAvailable(ctx context.Context, uri string) bool
}

Resource interface for MCP resources

type ResourceDefinition

type ResourceDefinition struct {
	URI         string                 `json:"uri"`
	Name        string                 `json:"name"`
	Description string                 `json:"description,omitempty"`
	MimeType    string                 `json:"mimeType,omitempty"`
	Metadata    map[string]interface{} `json:"metadata,omitempty"`
}

ResourceDefinition describes an MCP resource

type ResourceTemplate

type ResourceTemplate struct {
	URITemplate string `json:"uriTemplate"`
	Name        string `json:"name"`
	Description string `json:"description,omitempty"`
	MimeType    string `json:"mimeType,omitempty"`
}

ResourceTemplate represents a resource template that can match URIs

Jump to

Keyboard shortcuts

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