healthcheck

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2023 License: Apache-2.0, MIT, Apache-2.0, + 1 more Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CodeRunOkay      = "warpforge-error-healthcheck-run-okay"
	CodeRunFailure   = "warpforge-error-healthcheck-run-fail"
	CodeRunAmbiguous = "warpforge-error-healthcheck-run-ambiguous"
)
View Source
const (
	StatusCharacter_None      = "∅"
	StatusCharacter_Okay      = "✔"
	StatusCharacter_Failure   = "✘"
	StatusCharacter_Ambiguous = "?"
	StatusCharacter_Unknown   = "!"
)

Characters used to display status

View Source
const DefaultRootWorkspacePrefix = "warpforge-health-check-root-workspace-"

Variables

View Source
var DefaultBasePath = os.TempDir()

Functions

This section is empty.

Types

type BinCheck

type BinCheck struct {
	Name string
}

func (*BinCheck) Run

func (c *BinCheck) Run(ctx context.Context) error

Run checks that that an executable can be found for the given executable name Errors:

  • warpforge-error-healthcheck-run-okay -- when the binar is found
  • warpforge-error-healthcheck-run-fail -- when the binary cannot be found

func (*BinCheck) String

func (c *BinCheck) String() string

type ExecutionInfo

type ExecutionInfo struct {
	// The directory where a workspace directory will be created
	BasePath string
	// Prefix for the root workspace directory
	TmpDirPrefix string
	// The root workspace directory
	RootWorkspaceDir  string
	LocalWorkspaceDir string
}

func (*ExecutionInfo) Run

func (e *ExecutionInfo) Run(ctx context.Context) error

Run will configure and execute a basic warpforge plot to check for errors

Errors:

  • warpforge-error-healthcheck-run-okay --
  • warpforge-error-healthcheck-run-fail --

func (*ExecutionInfo) String

func (e *ExecutionInfo) String() string

type HealthCheck

type HealthCheck struct {
	Runners []Runner
	Results []serum.ErrorInterfaceWithMessage
}

func (*HealthCheck) Fprint

func (h *HealthCheck) Fprint(w io.Writer) error

Fprint emits formatted text of run results to the writer Errors:

  • warpforge-error-internal -- when the health check was not run before printing results

func (*HealthCheck) Run

func (h *HealthCheck) Run(ctx context.Context) error

Run executes all the runners assigned to this health check Errors: none -- Errors are just stored for later

func (*HealthCheck) TermColor

func (h *HealthCheck) TermColor(s HealthCheckStatus) *color.Color

type HealthCheckStatus

type HealthCheckStatus int
const (
	// StatusNone is the zero value and used for unset status value
	StatusNone HealthCheckStatus = iota
	StatusOkay
	StatusFail
	StatusAmbiguous
	StatusUnknown
)

func Status

func Status(err error) HealthCheckStatus

Status converts serum codes to status enumeration values

func (HealthCheckStatus) String

func (s HealthCheckStatus) String() string

type KernelInfo

type KernelInfo struct{}

func (*KernelInfo) Run

func (k *KernelInfo) Run(ctx context.Context) error

Run executes the checker Errors:

  • warpforge-error-healthcheck-run-fail -- syscall or serialization failure
  • warpforge-error-healthcheck-run-ambiguous -- returns kernel info

func (*KernelInfo) String

func (k *KernelInfo) String() string

type Runner

type Runner interface {
	// Run returns a serum error that contains a human readable message and a status code.
	// Runner should not return a nil
	// Errors:
	//
	//    - warpforge-error-healthcheck-run-okay --
	//    - warpforge-error-healthcheck-run-fail --
	//    - warpforge-error-healthcheck-run-ambiguous --
	Run(context.Context) error
	// Should be a header of some kind for the checker type
	String() string
}

type WorkspaceInfo

type WorkspaceInfo struct{}

This should locate and validate the workspace stack

Jump to

Keyboard shortcuts

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