endpoint

package
v1.18.0 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package endpoint hosts the `vet endpoint` cobra subcommand tree. The scan subcommand wires the inventory pipeline (pkg/inventory) into the CLI: scanners discover endpoint inventory, sinks render it locally and (when credentials are configured) ship it to SafeDep Cloud via endpointsync.

Index

Constants

View Source
const DefaultDrainTimeout = 30 * time.Second

DefaultDrainTimeout is the default `--drain-timeout` value and the fallback applied when Options.DrainTimeout is zero.

Variables

This section is empty.

Functions

func NewEndpointCommand

func NewEndpointCommand() *cobra.Command

NewEndpointCommand returns the `vet endpoint` cobra subcommand tree. Today the only child is `scan`; future commands (e.g. `endpoint status`) attach here as the surface grows.

func RunAITool

func RunAITool(ctx context.Context, opts Options) error

RunAITool runs the endpoint-scan pipeline pinned to the ai-tool kind. It is the integration point for cmd/ai/discover; opts.Kinds is overwritten.

Types

type Options

type Options struct {
	// Scopes restricts discovery to a subset of inventory scopes; nil
	// means "all scopes enabled" (mirrors aitool.DiscoveryConfig).
	Scopes []string
	// ProjectDir overrides the project root for project-scoped scans;
	// empty defaults to the process's cwd.
	ProjectDir string
	// ReportJSON, when non-empty, instructs LocalSink to marshal the
	// accumulated items to the supplied path on End.
	ReportJSON string
	// Silent suppresses the local table render at end-of-scan.
	Silent bool
	// Kinds is the scanner-kind allowlist; nil/empty means "all
	// registered kinds". Set directly by `vet endpoint scan`'s --kind
	// flag; overwritten by alias entrypoints.
	Kinds []string
	// DrainTimeout bounds CloudSink.Close's wait for pending events to
	// ship. Zero falls back to DefaultDrainTimeout.
	DrainTimeout time.Duration
}

Options is the public surface common to `vet endpoint scan` and the aliases that re-export it. cobra binds this directly. Aliases that pin a specific scanner kind (e.g. RunAITool) overwrite Options.Kinds before invoking the shared pipeline; callers of an alias entrypoint do not need to set Kinds; it is overwritten.

Jump to

Keyboard shortcuts

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