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 ¶
type SearchInput ¶
type SearchInput struct {
Query []string `json:"query,omitempty" cli:"positional" doc:"search query"`
}
SearchInput is search's input.
func (SearchInput) TransformSchema ¶
Click to show internal directories.
Click to hide internal directories.