cli

package
v1.2.0-beta.0 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2022 License: MPL-2.0 Imports: 17 Imported by: 1

Documentation

Overview

Package cli provides utilities for CLI tools.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fatalf

func Fatalf(message string, args ...interface{})

Fatalf prints formatted message to stderr and aborts execution.

func RenderGraph added in v0.14.0

func RenderGraph(ctx context.Context, c *client.Client, resp *inspect.ControllerRuntimeDependenciesResponse, output io.Writer, withResources bool) error

RenderGraph renders inspect controller runtime graph.

func RenderMounts added in v0.14.0

func RenderMounts(resp *machine.MountsResponse, output io.Writer, remotePeer *peer.Peer) error

RenderMounts renders mounts output.

func RenderServicesInfo added in v0.14.0

func RenderServicesInfo(services []client.ServiceInfo, output io.Writer, defaultNode string, withNodeInfo bool) error

RenderServicesInfo writes human readable service information to the io.Writer.

func Should

func Should(err error)

Should panics if err != nil

Should is useful when error should never happen in customer environment, it can only be development error.

func Warning

func Warning(message string, args ...interface{})

Warning prints formatted message to stderr.

func WithContext

func WithContext(ctx context.Context, f func(context.Context) error) error

WithContext wraps function call to provide a context cancellable with ^C.

Types

type ServiceInfoWrapper added in v0.14.0

type ServiceInfoWrapper struct {
	*machine.ServiceInfo
}

ServiceInfoWrapper helper that allows generating rich service information.

func (ServiceInfoWrapper) HealthStatus added in v0.14.0

func (svc ServiceInfoWrapper) HealthStatus() string

HealthStatus service health status.

func (ServiceInfoWrapper) LastEvent added in v0.14.0

func (svc ServiceInfoWrapper) LastEvent() string

LastEvent return last service event.

func (ServiceInfoWrapper) LastUpdated added in v0.14.0

func (svc ServiceInfoWrapper) LastUpdated() string

LastUpdated derive last updated time from events stream.

Jump to

Keyboard shortcuts

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