inventory

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: May 24, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	APIVersion = "torque.dev/ops/inventory/v1alpha1"
	ShowKind   = "InventoryShow"
)
View Source
const GraphKind = "InventoryGraph"

Variables

This section is empty.

Functions

func FormatLabels

func FormatLabels(labels map[string]string) string

func FormatList

func FormatList(values []string) string

func ParseSelector

func ParseSelector(values []string) (map[string]string, error)

func RedactSecretRefs

func RedactSecretRefs(value string) string

func RenderGraphHTML

func RenderGraphHTML(result GraphResult) ([]byte, error)

Types

type GraphEdge

type GraphEdge struct {
	From string `json:"from"`
	To   string `json:"to"`
	Kind string `json:"kind"`
}

type GraphNode

type GraphNode struct {
	ID       string            `json:"id"`
	Type     string            `json:"type"`
	Label    string            `json:"label"`
	Selected bool              `json:"selected,omitempty"`
	Labels   map[string]string `json:"labels,omitempty"`
	Metadata map[string]string `json:"metadata,omitempty"`
}

type GraphResult

type GraphResult struct {
	APIVersion        string                      `json:"apiVersion"`
	Kind              string                      `json:"kind"`
	GraphName         string                      `json:"graphName"`
	Summary           targetgraph.Summary         `json:"summary"`
	Selection         targetgraph.SelectionResult `json:"selection"`
	SelectedTargetIDs []string                    `json:"selectedTargetIds"`
	Nodes             []GraphNode                 `json:"nodes"`
	Edges             []GraphEdge                 `json:"edges"`
}

func Graph

func Graph(graph *targetgraph.TargetGraph, request ShowRequest) (GraphResult, error)

func (GraphResult) JSON

func (r GraphResult) JSON() ([]byte, error)

type ShowRequest

type ShowRequest struct {
	Selector map[string]string
	Groups   []string
	Limit    int
}

type ShowResult

type ShowResult struct {
	APIVersion string                      `json:"apiVersion"`
	Kind       string                      `json:"kind"`
	GraphName  string                      `json:"graphName"`
	Summary    targetgraph.Summary         `json:"summary"`
	Selection  targetgraph.SelectionResult `json:"selection"`
	Targets    []TargetView                `json:"targets"`
}

func Show

func Show(graph *targetgraph.TargetGraph, request ShowRequest) (ShowResult, error)

func (ShowResult) JSON

func (r ShowResult) JSON() ([]byte, error)

type TargetView

type TargetView struct {
	ID                  string            `json:"id"`
	Type                string            `json:"type"`
	TransportRef        string            `json:"transportRef,omitempty"`
	Labels              map[string]string `json:"labels,omitempty"`
	Groups              []string          `json:"groups,omitempty"`
	FactsTTL            string            `json:"factsTtl,omitempty"`
	FactsDiscovery      string            `json:"factsDiscovery,omitempty"`
	PrivilegeProfile    string            `json:"privilegeProfile,omitempty"`
	LockScope           string            `json:"lockScope,omitempty"`
	AllowedCapabilities []string          `json:"allowedCapabilities,omitempty"`
}

Jump to

Keyboard shortcuts

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