utils

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2021 License: MPL-2.0 Imports: 19 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CaptureStdout added in v0.1.0

func CaptureStdout(c callback) string

func CleanCommitCreatedAt added in v0.2.3

func CleanCommitCreatedAt(createdAt time.Time) string

func CleanCommitMessage added in v0.2.3

func CleanCommitMessage(msg string) string

func ConvertCommitHashToShort added in v0.2.3

func ConvertCommitHashToShort(hash string) string

func ConvertCommitURLToShort added in v0.3.0

func ConvertCommitURLToShort(url string) string

func CreateRepoSecretName added in v0.2.5

func CreateRepoSecretName(targetName string, repoURL string) string

func Exists added in v0.0.4

func Exists(filePath string) bool

func GenerateRandomString added in v0.3.0

func GenerateRandomString(min, max int) (string, error)

GenerateRandomString will create a new random string with alphanumeric characters. The length can also vary by using the min and max parameters. To have a consistent length such as 11, you would pass (11, 12) for the min and max respectively

func GetCommitMessage added in v0.2.0

func GetCommitMessage() string

func GetOwnerFromUrl added in v0.2.3

func GetOwnerFromUrl(url string) (string, error)

func PrintTable added in v0.2.3

func PrintTable(writer io.Writer, header []string, rows [][]string)

func SanitizeRepoUrl added in v0.2.3

func SanitizeRepoUrl(url string) string

SanitizeRepoUrl accepts a url like git@github.com:someuser/podinfo.git and converts it into a string like ssh://git@github.com/someuser/podinfo.git. This helps standardize the different user inputs that might be provided.

func SetCommmitMessage added in v0.2.3

func SetCommmitMessage(msg string)

func SetCommmitMessageFromArgs added in v0.2.0

func SetCommmitMessageFromArgs(cmd string, url, path, name string)

func StartK8sTestEnvironment added in v0.2.5

func StartK8sTestEnvironment() (client.Client, func(), error)

func UrlToRepoName added in v0.2.3

func UrlToRepoName(url string) string

func ValidateNamespace added in v0.2.3

func ValidateNamespace(ns string) error

func WaitUntil added in v0.0.4

func WaitUntil(out io.Writer, poll, timeout time.Duration, checkDone func() error) error

WaitUntil runs checkDone until a timeout is reached

Types

This section is empty.

Jump to

Keyboard shortcuts

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