reference

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

@index CCG reference parser for cross-namespace annotation links.

Index

Constants

View Source
const Scheme = "ccg"

Variables

This section is empty.

Functions

func CommonSuffixDepth

func CommonSuffixDepth(a, b string) int

CommonSuffixDepth returns the number of matching slash-separated path segments counted from the end of both inputs. @intent provide one deterministic import-reference similarity score for graph lookup and ingest resolution.

func Is

func Is(value string) bool

Is reports whether value uses the CCG reference scheme. @intent let callers branch between local @see values and cross-namespace CCG refs cheaply.

Types

type Ref

type Ref struct {
	Raw       string `json:"raw"`
	Namespace string `json:"namespace"`
	Path      string `json:"path,omitempty"`
	Symbol    string `json:"symbol,omitempty"`
	Scope     string `json:"scope"`
}

Ref is the structured form of a ccg:// annotation reference. @intent represent cross-namespace @see links without coupling annotations to graph storage.

func Parse

func Parse(value string) (*Ref, error)

Parse validates and normalizes a ccg:// reference. @intent decode ccg://{namespace}/{path}#{symbol} values used by @see annotations. @domainRule namespace is required and must be a single safe path segment. @domainRule path and symbol are optional; a path with no symbol represents a file or package path.

func (Ref) Display

func (r Ref) Display() string

Display returns a compact human-readable form for UI labels and logs. @intent shorten ccg refs while preserving namespace, path, and symbol identity.

Jump to

Keyboard shortcuts

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