diagnostics

package
v1.0.12 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2017 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Executables = []*Executable{
	&Executable{
		Command: we + " who",
	},
	&Executable{
		Description: "Installed version",
		Command:     we + " version",
	},
	&Executable{
		Command: we + " --verbose",
	},
	&Executable{
		Description: "Inspecting working directory context",
		Command:     we + " inspect context",
	},
	&Executable{
		Description: "Listing running services on local machine",
		Command:     we + " list --remote local",
	},
	&Executable{
		Description: "System docker images",
		LogFile:     "docker_images",
		Command:     "docker images",
	},
	&Executable{
		Description: "Docker services",
		LogFile:     "docker_ps",
		Command:     `docker ps -a --format "table {{.ID}}\t{{.Image}}\t{{.Status}}\t{{.Names}}"`,
	},
	&Executable{
		LogFile: "docker_ps",
		Command: "docker ps",
	},
	&Executable{
		Description: "Docker system-wide information",
		LogFile:     "docker_info",
		Command:     "docker info",
	},
	&Executable{
		Description: "Docker network list",
		LogFile:     "docker_network",
		Command:     "docker network ls",
	},
	&Executable{
		Description: "Inspecting WeDeploy docker network",
		LogFile:     "docker_network",
		Command:     "docker network inspect wedeploy",
	},
}

Executables is a list of executables

Functions

func Submit

func Submit(ctx context.Context, entry Entry) (err error)

Submit diagnostics

func Write

func Write(w io.Writer, r Report)

Write report

Types

type Diagnostics

type Diagnostics struct {
	Timeout     time.Duration
	Executables []*Executable
	Serial      bool
	// contains filtered or unexported fields
}

Diagnostics for the CLI and environment

func (*Diagnostics) Collect

func (d *Diagnostics) Collect() Report

Collect diagnostics

func (*Diagnostics) Run

func (d *Diagnostics) Run(ctx context.Context)

Run diagnostics

type Entry

type Entry struct {
	ID       string `json:"id"`
	Username string `json:"username"`
	Report   Report `json:"report"`
}

Entry for the diagnostics endpoint

type Executable

type Executable struct {
	Description string
	LogFile     string
	Command     string
	// IgnoreError if command exit code is != 0 (don't log)
	IgnoreError bool
	Required    bool
	// contains filtered or unexported fields
}

Executable is a command to be executed on the diagnostics

func (*Executable) Error

func (e *Executable) Error() error

type Report

type Report map[string][]byte

Report is a map of filename to content

func (*Report) Len

func (r *Report) Len() int

Len returns the number of bytes of a report

func (*Report) String added in v1.0.11

func (r *Report) String() map[string]string

String created from the report

Jump to

Keyboard shortcuts

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