primitives

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: Apache-2.0, Apache-2.0 Imports: 12 Imported by: 0 modules, 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

func MatchResourceTemplateURI

func MatchResourceTemplateURI(tmpl, uri string) (map[string]any, bool)

MatchResourceTemplateURI matches a URI against a URI template containing {path}.

Types

type PrimitiveManager

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

PrimitiveManager contains available resources for the server. Should be initialized with NewPrimitiveManager(). groups is the source of truth for named collections; toolset views (manifests) are derived from the group on demand by the callers that render them.

func NewPrimitiveManager

func NewPrimitiveManager(
	sourcesMap map[string]sources.Source,
	authServicesMap map[string]auth.AuthService,
	embeddingModelsMap map[string]embeddingmodels.EmbeddingModel,
	toolsMap map[string]tools.Tool,
	promptsMap map[string]prompts.Prompt,
	resourcesMap map[string]resources.Resource,
	resourceTemplatesMap map[string]resources.ResourceTemplate,
	groupsMap map[string]group.Group,
) *PrimitiveManager

func (*PrimitiveManager) AuthServices

func (r *PrimitiveManager) AuthServices() map[string]auth.AuthService

AuthServices returns a copy of the auth services map

func (*PrimitiveManager) CloseSources

func (r *PrimitiveManager) CloseSources()

CloseSources closes every source that holds connections (Blitz).

func (*PrimitiveManager) GetAuthService

func (r *PrimitiveManager) GetAuthService(authServiceName string) (auth.AuthService, bool)

func (*PrimitiveManager) GetEmbeddingModel

func (r *PrimitiveManager) GetEmbeddingModel(embeddingModelName string) (embeddingmodels.EmbeddingModel, bool)

func (*PrimitiveManager) GetGroup

func (r *PrimitiveManager) GetGroup(groupName string) (group.Group, bool)

GetGroup returns the group of the given name.

func (*PrimitiveManager) GetPrompt

func (r *PrimitiveManager) GetPrompt(promptName string) (prompts.Prompt, bool)

func (*PrimitiveManager) GetResource

func (r *PrimitiveManager) GetResource(name string) (resources.Resource, bool)

GetResource returns a specific resource by name.

func (*PrimitiveManager) GetResourceTemplate

func (r *PrimitiveManager) GetResourceTemplate(name string) (resources.ResourceTemplate, bool)

GetResourceTemplate returns a specific resource template by name.

func (*PrimitiveManager) GetSource

func (r *PrimitiveManager) GetSource(sourceName string) (sources.Source, bool)

func (*PrimitiveManager) GetTool

func (r *PrimitiveManager) GetTool(toolName string) (tools.Tool, bool)

func (*PrimitiveManager) GetUIResourceFromURI

func (r *PrimitiveManager) GetUIResourceFromURI(uri string) (resources.Resource, bool)

GetUIResourceFromURI returns a UI resource by matching its URI.

func (*PrimitiveManager) GetUIResourceTemplateByURI

func (r *PrimitiveManager) GetUIResourceTemplateByURI(uri string) (resources.ResourceTemplate, map[string]any, bool)

GetUIResourceTemplateByURI matches a URI against registered UI resource templates and returns the matching template along with extracted template parameters.

func (*PrimitiveManager) GroupsList

func (r *PrimitiveManager) GroupsList() []group.Group

GroupsList returns a copy of the groups list sorted alphabetically by name

func (*PrimitiveManager) SetPrimitives

func (r *PrimitiveManager) SetPrimitives(sourcesMap map[string]sources.Source, authServicesMap map[string]auth.AuthService, embeddingModelsMap map[string]embeddingmodels.EmbeddingModel, toolsMap map[string]tools.Tool, promptsMap map[string]prompts.Prompt, resourcesMap map[string]resources.Resource, resourceTemplatesMap map[string]resources.ResourceTemplate, groupsMap map[string]group.Group)

Jump to

Keyboard shortcuts

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