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

federation

package
v0.2.8 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Member

type Member struct {
	Project indexer.Project
	Files   graph.FileCatalog
}

Member pairs one federated index with its project so callers can build per-repository services without reaching into federation internals.

type ReadRepository

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

ReadRepository exposes the federated read surface without refresh, indexing, or embedding-write methods.

func OpenReadOnly

func OpenReadOnly(ctx context.Context, paths []string) (*ReadRepository, error)

OpenReadOnly opens existing compatible indexes without migrations or write capabilities and federates their query surfaces.

func OpenReadOnlyProjects

func OpenReadOnlyProjects(ctx context.Context, projects []indexer.Project) (*ReadRepository, error)

OpenReadOnlyProjects opens the exact discovered project generations supplied by a freshness coordinator. Unlike OpenReadOnly, it does not rediscover roots between the coordinator's stable post-refresh probe and publication.

func (*ReadRepository) CandidateNodes

func (r *ReadRepository) CandidateNodes(ctx context.Context) ([]graph.Node, error)

func (*ReadRepository) CanonicalMessages

func (*ReadRepository) Close

func (r *ReadRepository) Close() error

func (*ReadRepository) Counts

func (r *ReadRepository) Counts(ctx context.Context) (graph.Counts, error)

func (*ReadRepository) EdgesFrom

func (r *ReadRepository) EdgesFrom(ctx context.Context, id string) ([]graph.Edge, error)

func (*ReadRepository) EdgesTo

func (r *ReadRepository) EdgesTo(ctx context.Context, id string) ([]graph.Edge, error)

func (*ReadRepository) ListNodesByKind

func (r *ReadRepository) ListNodesByKind(ctx context.Context, request graph.NodeListQuery) ([]graph.ScopedNode, error)

func (*ReadRepository) MatchNodes

func (*ReadRepository) Members

func (r *ReadRepository) Members() []Member

func (*ReadRepository) Meta

func (r *ReadRepository) Meta(ctx context.Context, key string) (string, error)

func (*ReadRepository) Node

func (r *ReadRepository) Node(ctx context.Context, id string) (graph.Node, error)

func (*ReadRepository) ProjectForNode

func (r *ReadRepository) ProjectForNode(ctx context.Context, id string) (indexer.Project, error)

func (*ReadRepository) Projects

func (r *ReadRepository) Projects() []indexer.Project

func (*ReadRepository) RelationEdges

func (*ReadRepository) Repositories

func (r *ReadRepository) Repositories(ctx context.Context) ([]string, error)

func (*ReadRepository) SearchNodes

func (r *ReadRepository) SearchNodes(ctx context.Context, term string, limit int) ([]graph.Node, error)

type Repository

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

Repository presents multiple branch-specific SQLite indexes as one read-only graph and resolves explicit external targets against declarations in peers.

func Open

func Open(ctx context.Context, paths []string) (*Repository, error)

func OpenProjects

func OpenProjects(ctx context.Context, projects []indexer.Project) (*Repository, error)

OpenProjects opens the exact already-discovered writable project indexes. It is intended for generation-bound auxiliary writes such as embeddings; source indexing remains owned by the freshness coordinator.

func (*Repository) CandidateNodes

func (r *Repository) CandidateNodes(ctx context.Context) ([]graph.Node, error)

func (*Repository) CanonicalMessages

func (r *Repository) CanonicalMessages(ctx context.Context, request graph.CanonicalMessageQuery) (graph.CanonicalMessagePage, error)

CanonicalMessages merges already-filtered member pages, then applies one repository-qualified deterministic global bound.

func (*Repository) Close

func (r *Repository) Close() error

func (*Repository) Counts

func (r *Repository) Counts(ctx context.Context) (graph.Counts, error)

func (*Repository) EdgesFrom

func (r *Repository) EdgesFrom(ctx context.Context, id string) ([]graph.Edge, error)

func (*Repository) EdgesTo

func (r *Repository) EdgesTo(ctx context.Context, id string) ([]graph.Edge, error)

func (*Repository) ListNodesByKind

func (r *Repository) ListNodesByKind(ctx context.Context, request graph.NodeListQuery) ([]graph.ScopedNode, error)

ListNodesByKind enumerates catalog nodes across members and attributes each one to the repository that declares it. The per-kind bound applies to every member, so the caller still applies its own total bound.

func (*Repository) MatchNodes

func (r *Repository) MatchNodes(ctx context.Context, request graph.NodeMatchQuery) (graph.NodeMatchGroup, error)

MatchNodes merges the per-member match evidence for a selector. Only the strongest evidence any member reported contributes - the strongest level, and within it a local group over an external fallback - because a member holding stronger evidence always reports it itself. Totals sum across the contributing members so a federated ambiguity still states the true count.

func (*Repository) Members

func (r *Repository) Members() []Member

Members returns each federated index in deterministic order.

func (*Repository) Meta

func (r *Repository) Meta(ctx context.Context, key string) (string, error)

func (*Repository) Node

func (r *Repository) Node(ctx context.Context, id string) (graph.Node, error)

func (*Repository) ProjectForNode

func (r *Repository) ProjectForNode(ctx context.Context, id string) (indexer.Project, error)

func (*Repository) Projects

func (r *Repository) Projects() []indexer.Project

func (*Repository) Refresh

func (r *Repository) Refresh(ctx context.Context, parsers *parserapi.Registry) error

func (*Repository) RefreshReports

func (r *Repository) RefreshReports(ctx context.Context, parsers *parserapi.Registry, options indexer.Options) ([]indexer.Report, error)

RefreshReports refreshes members in canonical order and returns only reports for successful members. A failure is terminal and is never represented as a successful federation refresh.

func (*Repository) RelationEdges

func (r *Repository) RelationEdges(ctx context.Context, request graph.RelationEdgeQuery) (graph.RelationEdgePage, error)

RelationEdges merges bounded hydrated pages from every member, applies the same cross-repository projection as traversal adjacency, then deduplicates and enforces the global per-relation bound on final edge identities.

func (*Repository) Repositories

func (r *Repository) Repositories(_ context.Context) ([]string, error)

Repositories names every indexed repository in this federation.

func (*Repository) SearchNodes

func (r *Repository) SearchNodes(ctx context.Context, term string, limit int) ([]graph.Node, error)

Jump to

Keyboard shortcuts

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