pretty

package
v2.9.4 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// PipelineHeader is the header for pipelines.
	PipelineHeader = "PROJECT\tNAME\tVERSION\tINPUT\tCREATED\tSTATE / LAST JOB\tALERTS\tDESCRIPTION\t\n"
	// JobHeader is the header for jobs
	JobHeader = "PROJECT\tPIPELINE\tID\tSTARTED\tDURATION\tRESTART\tPROGRESS\tDL\tUL\tSTATE\t\n"
	// JobSetHeader is the header for jobsets
	JobSetHeader = "ID\tSUBJOBS\tPROGRESS\tCREATED\tMODIFIED\n"
	// DatumHeader is the header for datums
	DatumHeader = "ID\tFILES\tSTATUS\tTIME\t\n"
	// SecretHeader is the header for secrets
	SecretHeader = "NAME\tTYPE\tCREATED\t\n"

	// KubeEventsHeader is the header for kubernetes events
	KubeEventsHeader = "LAST SEEN\tTYPE\tREASON\tOBJECT\tMESSAGE\t\n"
	// CheckStatusHeader is the header for pipeline check statuse calls
	CheckStatusHeader = "PROJECT\tPIPELINE\tALERT\t\n"
)

Variables

This section is empty.

Functions

func Draw

func Draw(pis []*pps.PipelineInfo, opts ...RenderOption) (string, error)

func JobState

func JobState(jobState ppsclient.JobState) string

JobState returns the state of a job as a pretty printed string.

func ParseKubeEvent

func ParseKubeEvent(s string, event *KubeEvent) error

func PrintCheckStatus added in v2.9.0

func PrintCheckStatus(w io.Writer, checkSatusResponse *ppsclient.CheckStatusResponse)

func PrintCreatePipelineRequest added in v2.8.0

func PrintCreatePipelineRequest(w io.Writer, req *ppsclient.CreatePipelineRequest) error

PrintCreatePipelineRequest pretty-prints a create pipeline request.

func PrintDatumInfo

func PrintDatumInfo(w io.Writer, datumInfo *ppsclient.DatumInfo)

PrintDatumInfo pretty-prints file info. If recurse is false and directory size is 0, display "-" instead If fast is true and file size is 0, display "-" instead

func PrintDetailedDatumInfo

func PrintDetailedDatumInfo(w io.Writer, datumInfo *ppsclient.DatumInfo)

PrintDetailedDatumInfo pretty-prints detailed info about a datum

func PrintDetailedJobInfo

func PrintDetailedJobInfo(w io.Writer, jobInfo *PrintableJobInfo) error

PrintDetailedJobInfo pretty-prints detailed job info.

func PrintDetailedPipelineInfo

func PrintDetailedPipelineInfo(w io.Writer, pipelineInfo *PrintablePipelineInfo) error

PrintDetailedPipelineInfo pretty-prints detailed pipeline info.

func PrintFile

func PrintFile(w io.Writer, file *pfsclient.File)

PrintFile values for a pfs file.

func PrintFileHeader

func PrintFileHeader(w io.Writer)

PrintFileHeader prints the header for a pfs file.

func PrintJobInfo

func PrintJobInfo(w io.Writer, jobInfo *ppsclient.JobInfo, fullTimestamps bool)

PrintJobInfo pretty-prints job info.

func PrintJobSetInfo

func PrintJobSetInfo(w io.Writer, jobSetInfo *ppsclient.JobSetInfo, fullTimestamps bool)

PrintJobSetInfo pretty-prints jobset info.

func PrintKubeEvent

func PrintKubeEvent(w io.Writer, event string)

func PrintPipelineInfo

func PrintPipelineInfo(w io.Writer, pipelineInfo *ppsclient.PipelineInfo, fullTimestamps bool)

PrintPipelineInfo pretty-prints pipeline info.

func PrintSecretInfo

func PrintSecretInfo(w io.Writer, secretInfo *ppsclient.SecretInfo)

PrintSecretInfo pretty-prints secret info.

func PrintWorkerStatus

func PrintWorkerStatus(w io.Writer, workerStatus *ppsclient.WorkerStatus, fullTimestamps bool)

PrintWorkerStatus pretty prints a worker status.

func PrintWorkerStatusHeader

func PrintWorkerStatusHeader(w io.Writer)

PrintWorkerStatusHeader pretty prints a worker status header.

func Progress

func Progress(ji *ppsclient.JobInfo) string

Progress pretty prints the datum progress of a job.

func ShorthandInput

func ShorthandInput(input *ppsclient.Input) string

ShorthandInput renders a pps.Input as a short, readable string

Types

type KubeEvent

type KubeEvent struct {
	Message string `json:"msg"`
	Event   struct {
		Type     string `json:"type"`
		LastSeen uint64 `json:"lastTimestamp"`
		Reason   string `json:"reason"`
		Object   struct {
			Name string `json:"name"`
		} `json:"involvedObject"`
	} `json:"event"`
}

type PrintableJobInfo

type PrintableJobInfo struct {
	*ppsclient.JobInfo
	FullTimestamps bool
}

PrintableJobInfo is a wrapper around JobInfo containing any formatting options used within the template to conditionally print information.

func NewPrintableJobInfo

func NewPrintableJobInfo(ji *ppsclient.JobInfo, full bool) *PrintableJobInfo

NewPrintableJobInfo constructs a PrintableJobInfo from just a JobInfo.

type PrintablePipelineInfo

type PrintablePipelineInfo struct {
	*ppsclient.PipelineInfo
	FullTimestamps bool
}

PrintablePipelineInfo is a wrapper around PipelineInfo containing any formatting options used within the template to conditionally print information.

func NewPrintablePipelineInfo

func NewPrintablePipelineInfo(pi *ppsclient.PipelineInfo) *PrintablePipelineInfo

NewPrintablePipelineInfo constructs a PrintablePipelineInfo from just a PipelineInfo.

type RenderOption

type RenderOption func(*renderConfig)

func BoxWidthOption

func BoxWidthOption(boxWidth int) RenderOption

func EdgeHeightOption

func EdgeHeightOption(verticalSpace int) RenderOption

Jump to

Keyboard shortcuts

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