cli

package
v0.131.1 Latest Latest
Warning

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

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

Documentation

Overview

Package cli implements the `collect` command and its subcommands.

The per-collector subcommands (http, postgres, mysql, mssql, redis) run a single collector and print its native result JSON to stdout. This lets a collector run inside a Pod using the troubleshoot image — e.g. as a runPod collector — so the check executes from within the cluster instead of from wherever the CLI happens to be invoked.

Index

Constants

View Source
const (
	// FormatJSON is intended for CLI output.
	FormatJSON = "json"

	// FormatRaw is intended for consumption by a remote collector.  Output is a
	// string of quoted JSON.
	FormatRaw = "raw"
)

Variables

This section is empty.

Functions

func ClickhouseCmd added in v0.131.0

func ClickhouseCmd() *cobra.Command

ClickhouseCmd runs the clickhouse collector against a single database and prints the native result JSON ({"isConnected":..,"version":..,"error":..}).

func HTTPCmd added in v0.131.0

func HTTPCmd() *cobra.Command

HTTPCmd runs the http collector against a single endpoint and prints the native result JSON ({"response":{"status":...}} or {"error":{...}}).

func InitAndExecute

func InitAndExecute()

func MssqlCmd added in v0.131.0

func MssqlCmd() *cobra.Command

MssqlCmd runs the mssql collector against a single database and prints the native result JSON ({"isConnected":..,"version":..,"error":..}).

Unlike the other database collectors, the mssql collector does not honor a separate TLS field — TLS is configured through the connection URI query parameters (e.g. encrypt=true) — so this subcommand only takes --uri.

func MysqlCmd added in v0.131.0

func MysqlCmd() *cobra.Command

MysqlCmd runs the mysql collector against a single database and prints the native result JSON ({"isConnected":..,"version":..,"variables":..,"error":..}).

func PostgresCmd added in v0.131.0

func PostgresCmd() *cobra.Command

PostgresCmd runs the postgres collector against a single database and prints the native result JSON ({"isConnected":..,"version":..,"error":..}).

func RedisCmd added in v0.131.0

func RedisCmd() *cobra.Command

RedisCmd runs the redis collector against a single instance and prints the native result JSON ({"isConnected":..,"version":..,"error":..}).

func RootCmd

func RootCmd() *cobra.Command

Types

This section is empty.

Jump to

Keyboard shortcuts

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