resources

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Registry = &resourceRegistry{
	resources: make(map[string]types.Resource),
	ordered:   make([]string, 0),
}

Registry holds all registered resources

Functions

func Get

func Get(name string) (types.Resource, bool)

Get retrieves a resource by name

func GetDefinitions

func GetDefinitions() []types.ResourceDefinition

GetDefinitions returns all resource definitions

func Init

func Init()

Init initializes the resource registry

func NewDynamicResource added in v1.5.0

func NewDynamicResource(name, description, uri, mime string, content func() (string, error)) types.Resource

NewDynamicResource creates a resource with dynamic content function

func RegisterAll

func RegisterAll()

RegisterAll registers all built-in resources

Types

type BaseResource

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

BaseResource provides common resource functionality

func NewAPIDocResource

func NewAPIDocResource() *BaseResource

NewAPIDocResource creates a resource for API documentation

func NewReadmeResource

func NewReadmeResource() *BaseResource

NewReadmeResource creates a resource for the README

func NewSupportedLanguagesResource

func NewSupportedLanguagesResource() *BaseResource

func NewTransformationMethodsResource

func NewTransformationMethodsResource() *BaseResource

NewTransformationMethodsResource creates a resource listing transformation methods

func (*BaseResource) Contents

func (r *BaseResource) Contents() (string, error)

Contents returns the resource contents

func (*BaseResource) Description

func (r *BaseResource) Description() string

Description returns the resource description

func (*BaseResource) MimeType

func (r *BaseResource) MimeType() string

MimeType returns the resource MIME type

func (*BaseResource) Name

func (r *BaseResource) Name() string

Name returns the resource name

func (*BaseResource) URI

func (r *BaseResource) URI() string

URI returns the resource URI

func (*BaseResource) Watch added in v1.5.0

func (r *BaseResource) Watch(ctx context.Context) (<-chan types.ResourceUpdate, error)

Watch subscribes to resource updates when supported.

Jump to

Keyboard shortcuts

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