utils

package
v0.5.0-rc2 Latest Latest
Warning

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

Go to latest
Published: May 28, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DisplayArray

func DisplayArray(arr []string) (out string)

DisplayArray turn an array into a multi-line string containing its items

func DisplayMap added in v0.2.0

func DisplayMap(m map[string]string) (out string)

func GetBuildVersion added in v0.1.2

func GetBuildVersion() string

GetBuildVersion returns the CLI release version, or the latest git commit shorthash if the release could not be found (for local builds) Based on https://github.com/cue-lang/cue/issues/1697#issuecomment-1122097477

func GetProjectByPathOrUUID added in v0.5.2

func GetProjectByPathOrUUID(client *api.Client, project string) (*api.Project, error)

func IsCI added in v0.2.0

func IsCI() bool

func PollLogs added in v0.2.0

func PollLogs[S comparable](getLogs func() ([]api.LogEntry, error), getStatus func() (S, error), out io.Writer) (err error)

func SliceContains added in v0.2.0

func SliceContains[S ~[]T, T comparable](items S, el T) bool

SliceContains returns true if el in arr.

func SliceFilter

func SliceFilter[S ~[]T, T any](items S, f func(el T) bool) S

SliceFilter returns slice of T for which F returned true

func ToProjectPath added in v0.5.2

func ToProjectPath(client *api.Client, input string) (string, error)

ToProjectPath returns the path for a given project UUID or path

Types

This section is empty.

Jump to

Keyboard shortcuts

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