catalog

package
v0.8.0 Latest Latest
Warning

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

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

Documentation

Overview

Package catalog is the commands over the local search catalog: ingest builds it from the repo's context sources, and search queries it.

Index

Constants

This section is empty.

Variables

View Source
var Ingest = command.Define(command.Def[IngestInput, string]{
	Name:       "ingest",
	Short:      "Build the local search catalog from context sources",
	Idempotent: true,
	Timeout:    30 * time.Minute,
	Needs:      func(IngestInput) command.Sidecars { return command.Sidecars{Node: true, CanalQuery: true} },
	Run: func(ctx context.Context, cc command.CommandContext, in IngestInput) (string, error) {
		if err := command.RequireSidecars(cc, command.Sidecars{Node: true, CanalQuery: true}); err != nil {
			return "", err
		}
		return ingest.Run(ctx, cc.Clients.Node, cc.Clients.CanalQuery, cc.Repo, in.Source)
	},
})

Ingest builds the local search catalog from context sources.

View Source
var Search = command.Define(command.Def[SearchInput, anfranode.CatalogSearchResult]{
	Name:     "search",
	Short:    "Search the local catalog",
	ReadOnly: true,
	Needs:    func(SearchInput) command.Sidecars { return command.Sidecars{Node: true, CanalQuery: true} },
	Run: func(ctx context.Context, cc command.CommandContext, in SearchInput) (anfranode.CatalogSearchResult, error) {
		if err := command.RequireSidecars(cc, command.Sidecars{Node: true, CanalQuery: true}); err != nil {
			return nil, err
		}
		return search.Run(ctx, cc.Clients.Node, cc.Clients.CanalQuery, cc.Repo, strings.TrimSpace(strings.Join(in.Query, " ")))
	},
})

Search searches the local catalog.

Functions

This section is empty.

Types

type IngestInput

type IngestInput struct {
	Source string `json:"source,omitempty" short:"s" doc:"optional context source key to ingest"`
}

IngestInput is ingest's input.

func (IngestInput) TransformSchema

func (IngestInput) TransformSchema(_ huma.Registry, s *huma.Schema) *huma.Schema

type SearchInput

type SearchInput struct {
	Query []string `json:"query,omitempty" cli:"positional" doc:"search query"`
}

SearchInput is search's input.

func (SearchInput) TransformSchema

func (SearchInput) TransformSchema(_ huma.Registry, s *huma.Schema) *huma.Schema

Jump to

Keyboard shortcuts

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