hostapi

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: May 6, 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) (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"`
	Name               string `json:"name,omitempty"`
	NameRegex          string `json:"name_regex,omitempty"`
	Providers          string `json:"providers,omitempty"`
	Backends           string `json:"backends,omitempty"`
	GCPProject         string `json:"gcp_project,omitempty"`
	GCPZone            string `json:"gcp_zone,omitempty"`
	AWSProfile         string `json:"aws_profile,omitempty"`
	AWSRegion          string `json:"aws_region,omitempty"`
	KubeContext        string `json:"kube_context,omitempty"`
	Kubeconfig         string `json:"kubeconfig,omitempty"`
	K8sMode            string `json:"k8s_mode,omitempty"`
	K8sDebugImage      string `json:"k8s_debug_image,omitempty"`
	ConsulAddr         string `json:"consul_addr,omitempty"`
	ConsulDC           string `json:"consul_datacenter,omitempty"`
	ConsulToken        string `json:"consul_token,omitempty"`
	ProxmoxURL         string `json:"proxmox_url,omitempty"`
	ProxmoxUser        string `json:"proxmox_user,omitempty"`
	ProxmoxPassword    string `json:"proxmox_password,omitempty"`
	ProxmoxTokenID     string `json:"proxmox_token_id,omitempty"`
	ProxmoxTokenSecret string `json:"proxmox_token_secret,omitempty"`
	ProxmoxInsecure    bool   `json:"proxmox_insecure,omitempty"`
	CacheTTL           string `json:"cache_ttl,omitempty"`
	CacheDir           string `json:"cache_dir,omitempty"`
	NoCache            bool   `json:"no_cache,omitempty"`
	Refresh            bool   `json:"refresh,omitempty"`
}

SearchHostsInput mirrors MCP search_hosts and the web /api/v1/search JSON body.

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) (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