hostapi

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package hostapi implements shared host search and backend listing for HTTP and MCP surfaces.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MergeSearchDefaultsFromConfig

func MergeSearchDefaultsFromConfig(cfg *config.File, q *hosts.Query)

MergeSearchDefaultsFromConfig applies config defaults to q when fields are empty.

Types

type ListBackendsOutput

type ListBackendsOutput struct {
	ConfigPath string              `json:"config_path"`
	Backends   []config.BackendRow `json:"backends"`
}

ListBackendsOutput matches MCP list_backends response shape.

func ListBackends

func ListBackends(configPath string, searchReg *searchrun.Registry) (ListBackendsOutput, error)

ListBackends resolves config the same way as honey backends / MCP list_backends.

type SearchHostsInput

type SearchHostsInput struct {
	ConfigPath string                      `json:"config_path,omitempty" mod:"trim"`
	Name       string                      `json:"name,omitempty"        mod:"trim"`
	NameRegex  string                      `json:"name_regex,omitempty"  mod:"trim"`
	Providers  string                      `json:"providers,omitempty"   mod:"trim"`
	Backends   string                      `json:"backends,omitempty"    mod:"trim"`
	SSHUser    string                      `json:"ssh_user,omitempty"    mod:"trim"`
	CacheTTL   string                      `json:"cache_ttl,omitempty"   mod:"trim"`
	CacheDir   string                      `json:"cache_dir,omitempty"   mod:"trim"`
	NoCache    bool                        `json:"no_cache,omitempty"`
	Refresh    bool                        `json:"refresh,omitempty"`
	Overrides  searchrun.ProviderOverrides `json:"overrides,omitempty"`
}

SearchHostsInput mirrors MCP search_hosts and the web /api/v1/search JSON body. Overrides is an opaque map passed through to provider factories — callers do not need to know which fields any specific provider accepts.

type SearchHostsOutput

type SearchHostsOutput struct {
	Records []hosts.Record `json:"records"`
	Count   int            `json:"count"`
}

SearchHostsOutput is the JSON search result.

func SearchHosts

func SearchHosts(ctx context.Context, in *SearchHostsInput, reg hostexec.Registry, searchReg *searchrun.Registry) (SearchHostsOutput, error)

SearchHosts runs the same search pipeline as honey search / MCP search_hosts.

Jump to

Keyboard shortcuts

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