Documentation
¶
Overview ¶
Package command for archive Archive compresses command output into a zip file
Package command for HashiCorp's Consul https://consul.io/ VaultCommand executes commands with the consul command line internally and stores the output in plain text files
Package command for info [WIP] Info executes commands and displays a mini dashboard
Package command for HashiCorp's Nomad https://nomadproject.io/ VaultCommand executes commands with the nomad command line internally and stores the output in plain text files
Package command for system System executes operating system commands and stores output
Package command for upload Upload puts the archive file into an S3 bucket
Package command for HashiCorp's Vault https://vaultproject.io/ VaultCommand executes commands with the vault command line internally and stores the output in plain text files
Index ¶
- Constants
- func ActiveLocalVersion(binary string) (string, error)
- func CheckHashiVersion(name string) string
- func CheckProc(name string) (string, error)
- func Dump(dumpType string, outfile string, cmdName string, args ...string) int
- func FileExist(fileName string) bool
- func GetHostName() (string, error)
- func HTTPCmdCheck() string
- func ZipIt(target string)
- type ArchiveCommand
- type ConsulCommand
- type InfoCommand
- type Internal
- type NomadCommand
- type SystemCommand
- type UploadCommand
- type VaultCommand
Constants ¶
const ( // CheckpointURLBase is the URL base for CheckPoint API CheckpointURLBase string = "https://checkpoint-api.hashicorp.com" // ReleaseURLBase is the URL base for the HashiCorp releases website ReleaseURLBase string = "https://releases.hashicorp.com" // VaultReleaseURLBase is the URL base for the Vault releases page VaultReleaseURLBase string = "https://releases.hashicorp.com/vault/" // Consul binary name Consul string = "consul" // ConsulTemplate binary name ConsulTemplate string = "consul-template" // EnvConsul binary name EnvConsul string = "envconsul" // Nomad binary name Nomad string = "nomad" // Packer binary name Packer string = "packer" // Sentinel binary name Sentinel string = "sentinel" // Terraform binary name Terraform string = "terraform" // Vagrant binary name Vagrant string = "vagrant" // Vault binary name Vault string = "vault" )
Variables ¶
This section is empty.
Functions ¶
func ActiveLocalVersion ¶
ActiveLocalVersion tries to locate binary tools in the system path and get their version using OS calls 'consul version' has a slightly different output style from the others, and must be handled differently
func CheckHashiVersion ¶
CheckHashiVersion attempts to locate HashiCorp runtime tools in and get their versions - Consul has slightly different version output style so it must be handled differently
func CheckProc ¶
CheckProc checks for a running process by name with pgrep or ps and returns its PID
func Dump ¶
Dump takes a type, output filename and command, which it then executes while also writing stdout + stderr to a file named for the command Inspired by debug-ninja! (https://github.com/fprimex/debug-ninja)
func GetHostName ¶
GetHostName gets the current system's network hostname
func HTTPCmdCheck ¶
func HTTPCmdCheck() string
HTTPCmdCheck checks for curl or wget and use what is present
Types ¶
type ArchiveCommand ¶
type ArchiveCommand struct {
ArchivePath string
HostName string
OS string
KeepData bool
TargetFile string
UI cli.Ui
}
ArchiveCommand describes common zip file fields
type ConsulCommand ¶
type ConsulCommand struct {
ConsulPID string
HostName string
HTTPCommand string
HTTPTokenValue string
OS string
OutputPath string
UI cli.Ui
}
ConsulCommand describes Consul related fields
type InfoCommand ¶
type InfoCommand struct {
ConsulVersion string
HostName string
NomadVersion string
OS string
Uptime string
UI cli.Ui
VaultVersion string
}
InfoCommand describes info dashboard related fields
type Internal ¶
type Internal struct {
ConsulVersion string
HostName string
NomadVersion string
OS string
LogFile string
TargetFile string
VaultVersion string
}
Internal describes fields which support the internal commands
type NomadCommand ¶
NomadCommand describes Nomad related fields
type SystemCommand ¶
type SystemCommand struct {
Arch string
HostName string
OS string
ReleaseFiles []string
UI cli.Ui
LogFile string
}
SystemCommand describes system related fields
type UploadCommand ¶
type UploadCommand struct {
AccessKey string
ArchiveFile string
Bucket string
HostName string
OS string
Prefix string
Region string
SecretKey string
Token string
UI cli.Ui
}
UploadCommand describes upload related fields