query

package
v3.6.1 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2026 License: MIT Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package query is the read-only view layer over the manifest + inventory that backs list/view (and feeds audit). It returns structured data only; rendering lives with the caller, so the CLI and the future TUI format it however they like. Provider category powers --type; the host's free-form tags power --tag.

Index

Constants

View Source
const (
	NoKey         = "no-key"
	NeedsRedeploy = "needs-redeploy"
	Deployed      = "deployed"
)

Deployment status values.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeploymentRow

type DeploymentRow struct {
	Target   string
	Method   string
	Verified bool
}

DeploymentRow is one recorded deployment of a key.

type HostDetail

type HostDetail struct {
	Profile       string
	Alias         string
	Hostname      string
	User          string
	Port          int
	IdentityFile  string
	KnownHosts    string
	ProviderLabel string
	KeyName       string
	Status        string
	Fingerprint   *string
	ExpiresOn     *string
	Tags          []string
	RawOptions    manifest.OrderedOptions
	Deployments   []DeploymentRow
	RequiresVPN   bool
	VPNName       *string
	VPNURL        *string
}

HostDetail is the resolved view of a single host (view <alias>).

type HostRow

type HostRow struct {
	Alias         string
	Hostname      string
	ProviderLabel string // e.g. "github/vcs" or "server"
	KeyName       string
	Status        string // no-key | needs-redeploy | deployed
	Tags          []string
}

HostRow is one host in a list view.

type ProfileGroup

type ProfileGroup struct {
	Name  string
	Empty bool // the profile has no hosts at all
	Rows  []HostRow
}

ProfileGroup is a profile and its (possibly filtered) host rows.

type ProfileSummary

type ProfileSummary struct {
	Name     string
	KeyScope string
	Rows     []HostRow
}

ProfileSummary is the resolved view of a whole profile (view <profile>).

type Query

type Query struct {
	// contains filtered or unexported fields
}

Query answers read-only questions about the manifest + inventory.

func New

func New(m *manifest.Manifest, inv *inventory.Inventory, providersFile string) *Query

New builds a Query. providersFile is the user's providers.json (may be absent; the embedded default catalog is used as the fallback).

func (*Query) Detail

func (q *Query) Detail(selector string) (any, error)

Detail returns a *ProfileSummary when selector names a profile, else a *HostDetail when it matches a host alias, else an error.

func (*Query) Groups

func (q *Query) Groups(profile, provider, type_, tag string) ([]ProfileGroup, error)

Groups returns the list view, filtered by any of profile/provider/type_/tag (empty string means no filter on that axis).

Jump to

Keyboard shortcuts

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