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: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// RepoHeader is the header for repos.
	RepoHeader = "PROJECT\tNAME\tCREATED\tSIZE (MASTER)\tDESCRIPTION\t\n"
	// RepoAuthHeader is the header for repos with auth information attached.
	RepoAuthHeader = "PROJECT\tNAME\tCREATED\tSIZE (MASTER)\tACCESS_LEVEL\tDESCRIPTION\t\n"
	// CommitHeader is the header for commits.
	CommitHeader = "PROJECT\tREPO\tBRANCH\tCOMMIT\tFINISHED\tSIZE\tORIGIN\tDESCRIPTION\t\n"
	// CommitSetHeader is the header for commitsets.
	CommitSetHeader = "ID\tSUBCOMMITS\tPROGRESS\tCREATED\tMODIFIED\t\n"
	// BranchHeader is the header for branches.
	BranchHeader = "BRANCH\tHEAD\tTRIGGER\t\n"
	// ProjectHeader is the header for the projects.
	ProjectHeader = "ACTIVE\tPROJECT\tCREATED\tDESCRIPTION\n"
	// ProjectAuthHeader is the header for the projects with auth info attached.
	ProjectAuthHeader = "ACTIVE\tPROJECT\tACCESS_LEVEL\tCREATED\tDESCRIPTION\n"
	// FileHeader is the header for files.  It pads SIZE to allow up to four
	// characters (e.g. “1023”) followed by a unit such as “KiB.”
	FileHeader = "SIZE   \tNAME\n"
	// FileHeaderWithCommit is the header for files that includes a commit field.
	FileHeaderWithCommit = "COMMIT\tNAME\tTYPE\tCOMMITTED\tSIZE\t\n"
	// DiffFileHeader is the header for files produced by diff file.
	DiffFileHeader = "OP\t" + FileHeader
)

Variables

This section is empty.

Functions

func CompactPrintCommit

func CompactPrintCommit(c *pfs.Commit) string

CompactPrintCommit renders 'c' as a compact string, e.g. "myrepo@123abc:/my/file"

func CompactPrintCommitSafe

func CompactPrintCommitSafe(c *pfs.Commit) string

CompactPrintCommitSafe is similar to CompactPrintCommit but accepts 'nil' arguments

func CompactPrintFile

func CompactPrintFile(f *pfs.File) string

CompactPrintFile renders 'f' as a compact string, e.g. "myrepo@master:/my/file"

func PrintBranch

func PrintBranch(w io.Writer, branchInfo *pfs.BranchInfo)

PrintBranch pretty-prints a Branch.

func PrintCommitInfo

func PrintCommitInfo(w io.Writer, commitInfo *pfs.CommitInfo, fullTimestamps bool)

PrintCommitInfo pretty-prints commit info.

func PrintCommitSetInfo

func PrintCommitSetInfo(w io.Writer, commitSetInfo *pfs.CommitSetInfo, fullTimestamps bool)

PrintCommitSetInfo pretty-prints jobset info.

func PrintDetailedBranchInfo

func PrintDetailedBranchInfo(branchInfo *pfs.BranchInfo) error

PrintDetailedBranchInfo pretty-prints detailed branch info.

func PrintDetailedCommitInfo

func PrintDetailedCommitInfo(w io.Writer, commitInfo *PrintableCommitInfo) error

PrintDetailedCommitInfo pretty-prints detailed commit info.

func PrintDetailedFileInfo

func PrintDetailedFileInfo(fileInfo *pfs.FileInfo) error

PrintDetailedFileInfo pretty-prints detailed file info.

func PrintDetailedInspectProjectV2Response added in v2.9.0

func PrintDetailedInspectProjectV2Response(resp *pfs.InspectProjectV2Response) error

PrintDetailedProjectInfo pretty-prints detailed project info.

func PrintDetailedRepoInfo

func PrintDetailedRepoInfo(repoInfo *PrintableRepoInfo) error

PrintDetailedRepoInfo pretty-prints detailed repo info.

func PrintDiffFileInfo

func PrintDiffFileInfo(w io.Writer, added bool, fileInfo *pfs.FileInfo)

PrintDiffFileInfo pretty-prints a file info from diff file.

func PrintFileInfo

func PrintFileInfo(w io.Writer, fileInfo *pfs.FileInfo)

PrintFileInfo pretty-prints file info.

func PrintFindCommits

func PrintFindCommits(client pfs.API_FindCommitsClient) error

func PrintProjectInfo

func PrintProjectInfo(w io.Writer, projectInfo *pfs.ProjectInfo, currentProject *pfs.Project)

PrintProjectInfo pretty-prints a project.

func PrintRepoInfo

func PrintRepoInfo(w io.Writer, repoInfo *pfs.RepoInfo, fullTimestamps bool)

PrintRepoInfo pretty-prints repo info.

Types

type PrintableCommitInfo

type PrintableCommitInfo struct {
	*pfs.CommitInfo
	FullTimestamps bool
}

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

func NewPrintableCommitInfo

func NewPrintableCommitInfo(ci *pfs.CommitInfo) *PrintableCommitInfo

NewPrintableCommitInfo constructs a PrintableCommitInfo from just a CommitInfo.

type PrintableRepoInfo

type PrintableRepoInfo struct {
	*pfs.RepoInfo
	FullTimestamps bool
}

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

func NewPrintableRepoInfo

func NewPrintableRepoInfo(ri *pfs.RepoInfo) *PrintableRepoInfo

NewPrintableRepoInfo constructs a PrintableRepoInfo from just a RepoInfo.

Jump to

Keyboard shortcuts

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