hostapi

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 24, 2026 License: MIT Imports: 8 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"`
	TrueNASURL          string `json:"truenas_url,omitempty"`
	TrueNASUser         string `json:"truenas_user,omitempty"`
	TrueNASAPIKey       string `json:"truenas_api_key,omitempty"`
	TrueNASInsecure     bool   `json:"truenas_insecure,omitempty"`
	DockerHost          string `json:"docker_host,omitempty"`
	DockerMode          string `json:"docker_mode,omitempty"`
	DockerAllContainers bool   `json:"docker_all_containers,omitempty"`
	DockerViaLocal      string `json:"docker_via_local,omitempty"`
	DockerViaSSHHost    string `json:"docker_via_ssh_host,omitempty"`
	DockerSocket        string `json:"docker_socket,omitempty"`
	DockerPlatform      string `json:"docker_platform,omitempty"`
	SSHUser             string `json:"ssh_user,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