formatting

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: Apache-2.0 Imports: 19 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PipelineRunStatusText string
View Source
var QueuingPipelineRunText string
View Source
var StartingPipelineRunText string

Functions

func Age

func Age(t *metav1.Time, c clockwork.Clock) string

func CamelCasit

func CamelCasit(s string) string

CamelCasit pull_request > PullRequest.

func CleanKubernetesName added in v0.21.5

func CleanKubernetesName(s string) string

func CleanValueKubernetes added in v0.18.0

func CleanValueKubernetes(s string) string

CleanValueKubernetes conform a string to kubernetes naming convention see https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#dns-subdomain-names rules are: • contain at most 63 characters • contain only lowercase alphanumeric characters or '-' • start with an alphanumeric character • end with an alphanumeric character.

func ConditionEmoji

func ConditionEmoji(c knative1.Conditions) string

func ConditionSad added in v0.12.0

func ConditionSad(c knative1.Conditions) string

func Duration

func Duration(t1, t2 *metav1.Time) string

func GetRepoOwnerFromURL

func GetRepoOwnerFromURL(ghURL string) (string, error)

func GetRepoOwnerSplitted

func GetRepoOwnerSplitted(u string) (string, string, error)

func PRDuration added in v0.13.0

func PRDuration(runStatus v1alpha1.RepositoryRunStatus) string

PRDuration calculates the duration of a repository run, given its status. It takes a RepositoryRunStatus object as input. It returns a string with the duration of the run, or nonAttributedStr if the run has not started or completed.

func PipelineRunStatus

func PipelineRunStatus(pr *tektonv1.PipelineRun) string

PipelineRunStatus return status of PR success failed or skipped.

func SanitizeBranch

func SanitizeBranch(s string) string

SanitizeBranch remove refs/heads from string, only removing the first prefix in case we have branch that are actually called refs-heads 🙃.

func ShortSHA

func ShortSHA(sha string) string

ShortSHA returns a shortsha.

func ShowLastAge

func ShowLastAge(repository v1alpha1.Repository, cw clockwork.Clock) string

func ShowLastSHA

func ShowLastSHA(repository v1alpha1.Repository) string

func ShowStatus

func ShowStatus(repository v1alpha1.Repository, cs *cli.ColorScheme) string

func Timeout

func Timeout(t *metav1.Duration) string

func UniqueStringArray added in v0.23.0

func UniqueStringArray(slice []string) []string

Types

type MessageTemplate added in v0.22.0

type MessageTemplate struct {
	PipelineRunName string
	Namespace       string
	NamespaceURL    string
	ConsoleName     string
	ConsoleURL      string
	TknBinary       string
	TknBinaryURL    string
	TaskStatus      string
	FailureSnippet  string
}

func (MessageTemplate) MakeTemplate added in v0.22.0

func (mt MessageTemplate) MakeTemplate(tmpl string) (string, error)

Jump to

Keyboard shortcuts

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