cmd

package
v0.39.8 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2026 License: MIT Imports: 49 Imported by: 0

Documentation

Overview

Package cmd provides the CLI commands for bosun.

Package cmd provides the CLI commands for bosun.

Package cmd provides the CLI commands for bosun.

Package cmd provides the CLI commands for bosun.

Package cmd provides the CLI commands for bosun.

Package cmd provides the CLI commands for bosun.

Package cmd provides the CLI commands for bosun.

Index

Constants

View Source
const (
	// RadioTestTimeout is the HTTP timeout for testing the webhook endpoint.
	RadioTestTimeout = 5 * time.Second
	// MaxOnlinePeersDisplay is the maximum number of online tunnel peers to show.
	MaxOnlinePeersDisplay = 5
	// TunnelStatusTimeout is the timeout for tunnel status checks.
	TunnelStatusTimeout = 10 * time.Second
)

Radio command constants.

View Source
const (
	// MaxPortDisplayLength is the maximum length for displaying port mappings before truncation.
	MaxPortDisplayLength = 40
	// TruncatedPortLength is the length to truncate port display to when exceeding max.
	TruncatedPortLength = 37
	// DefaultLogTailLines is the default number of log lines to show.
	DefaultLogTailLines = 100
)

Display limits for crew commands.

View Source
const (

	// Display limits for diagnostics commands.
	// MaxRecentActivityDisplay is the maximum number of recent containers to show.
	MaxRecentActivityDisplay = 5
	// MaxDeployTagsDisplay is the maximum number of deploy tags to show.
	MaxDeployTagsDisplay = 5
	// MaxProvisionTimestamps is the maximum number of provision timestamps to show.
	MaxProvisionTimestamps = 10
	// DefaultLogHistoryCount is the default number of log history entries to show.
	DefaultLogHistoryCount = 10
)

Command timeouts and display limits.

View Source
const (
	// MaxErrorDisplay is the maximum number of error lines to show in mayday output.
	MaxErrorDisplay = 50
	// MaxSnapshotDisplay is the maximum number of snapshots to show in list output.
	MaxSnapshotDisplay = 10
	// MaxBackupDisplay is the maximum number of backups to show in list output.
	MaxBackupDisplay = 10
	// MaxSnapshotPrompt is the maximum number of snapshots to show in interactive prompt.
	MaxSnapshotPrompt = 5
	// ContainerLogTailLines is the number of log lines to fetch per container for error scanning.
	ContainerLogTailLines = 20
	// DockerLogHeaderSize is the size of Docker's multiplexed log header in bytes.
	DockerLogHeaderSize = 8
	// MaxExtractFileSize is the maximum file size allowed when extracting tar archives (100MB).
	MaxExtractFileSize = 100 * 1024 * 1024
	// MaxExtractFileCount is the maximum number of files allowed in a tar archive (tar bomb protection).
	MaxExtractFileCount = 1000
	// MaxExtractTotalSize is the maximum total size allowed when extracting tar archives (50GB).
	MaxExtractTotalSize = 50 * 1024 * 1024 * 1024
)

Emergency command display limits.

View Source
const (
	// ComposeCommandTimeout is the maximum time allowed for compose commands.
	ComposeCommandTimeout = 5 * time.Minute
)

Compose command timeouts.

View Source
const DefaultOperationTimeout = 30 * time.Second

DefaultOperationTimeout is the default timeout for Docker operations.

View Source
const (
	// MaxDiffOutputLines is the maximum number of lines to show in diff output before truncation.
	MaxDiffOutputLines = 50
)

Provision command display limits.

Variables

This section is empty.

Functions

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags appropriately.

Types

type BackupInfo

type BackupInfo struct {
	Name    string
	Path    string
	HasTar  bool
	ModTime string
}

BackupInfo contains information about a backup.

type CheckResult

type CheckResult struct {
	Passed int
	Failed int
	Warned int
}

CheckResult holds the results of a diagnostic check.

func (*CheckResult) Add

func (r *CheckResult) Add(other CheckResult)

Add combines two CheckResults.

type ComposeFile

type ComposeFile struct {
	Services map[string]struct {
		Image string `yaml:"image"`
	} `yaml:"services"`
}

ComposeFile represents a Docker Compose file structure for YAML parsing.

type ComposeFileWithDeps

type ComposeFileWithDeps struct {
	Services map[string]struct {
		DependsOn any `yaml:"depends_on"`
	} `yaml:"services"`
}

ComposeFileWithDeps represents a Docker Compose file with dependencies for YAML parsing.

type ComposeFileWithPorts

type ComposeFileWithPorts struct {
	Services map[string]ServiceWithPorts `yaml:"services"`
}

ComposeFileWithPorts represents a Docker Compose file structure for port extraction.

type PortMapping

type PortMapping struct {
	Port        int
	ServiceName string
	Source      string // "ports" or "traefik"
}

PortMapping represents a port extracted from a compose file.

type ServiceWithPorts

type ServiceWithPorts struct {
	Ports  []any             `yaml:"ports"`
	Labels map[string]string `yaml:"labels"`
}

ServiceWithPorts represents a service with ports and labels.

type TailscalePeer

type TailscalePeer struct {
	DNSName      string   `json:"DNSName"`
	HostName     string   `json:"HostName"`
	TailscaleIPs []string `json:"TailscaleIPs"`
	Online       bool     `json:"Online"`
	ExitNode     bool     `json:"ExitNode"`
	Active       bool     `json:"Active"`
}

TailscalePeer represents a peer in the Tailscale network. Kept for backwards compatibility with existing tests.

type TailscaleStatus

type TailscaleStatus struct {
	BackendState   string                   `json:"BackendState"`
	Self           TailscalePeer            `json:"Self"`
	Peer           map[string]TailscalePeer `json:"Peer"`
	MagicDNSSuffix string                   `json:"MagicDNSSuffix"`
}

TailscaleStatus represents the JSON output of tailscale status --json. Kept for backwards compatibility with existing tests.

Jump to

Keyboard shortcuts

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