Documentation ¶
Overview ¶
Package cli provides utilities for CLI tools.
Index ¶
- func Fatalf(message string, args ...interface{})
- func RenderGraph(ctx context.Context, c *client.Client, ...) error
- func RenderMounts(resp *machine.MountsResponse, output io.Writer, remotePeer *peer.Peer) error
- func RenderServicesInfo(services []client.ServiceInfo, output io.Writer, defaultNode string, ...) error
- func Should(err error)
- func Warning(message string, args ...interface{})
- func WithContext(ctx context.Context, f func(context.Context) error) error
- type ServiceInfoWrapper
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 ¶
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.
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.
Click to show internal directories.
Click to hide internal directories.