cli

package
v1.6.4 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2024 License: MPL-2.0 Imports: 17 Imported by: 2

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

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

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

RenderMounts renders mounts output.

func RenderServicesInfo

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

type ServiceInfoWrapper struct {
	*machine.ServiceInfo
}

ServiceInfoWrapper helper that allows generating rich service information.

func (ServiceInfoWrapper) HealthStatus

func (svc ServiceInfoWrapper) HealthStatus() string

HealthStatus service health status.

func (ServiceInfoWrapper) LastEvent

func (svc ServiceInfoWrapper) LastEvent() string

LastEvent return last service event.

func (ServiceInfoWrapper) LastUpdated

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