Help us shape the future of Go! Take the 2026 Go Developer Survey

docresolver

package
v1.0.66 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package docresolver resolves document IDs, URLs, and natural titles to one typed document target before a shortcut performs a business operation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Candidate

type Candidate struct {
	CanonicalID  string `json:"canonicalId"`
	Name         string `json:"name,omitempty"`
	Product      string `json:"product"`
	ResourceType string `json:"resourceType,omitempty"`
	URL          string `json:"canonicalUrl,omitempty"`
	ContainerID  string `json:"containerId,omitempty"`
}

Candidate is a credential-free document search candidate.

type Reader

type Reader interface {
	CallMCPData(product, tool string, params map[string]any) (map[string]any, error)
}

Reader is the read-only RuntimeContext surface needed by the resolver.

type Resolution

type Resolution struct {
	ContractVersion string      `json:"contractVersion"`
	Status          string      `json:"status"`
	Query           string      `json:"query,omitempty"`
	MatchedBy       string      `json:"matchedBy"`
	Complete        bool        `json:"complete"`
	Selected        Candidate   `json:"selected"`
	Candidates      []Candidate `json:"candidates"`
}

Resolution is the stable result consumed by document shortcuts.

func Resolve

func Resolve(rt Reader, node, query string) (Resolution, error)

Resolve accepts exactly one stable node/URL or natural title. Natural title resolution exhausts pagination before selecting a unique candidate.

Jump to

Keyboard shortcuts

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