Documentation ¶
Index ¶
- func CheckExistingContext(contextName, kubeconfig string) bool
- func ContextWithCancelOnSignals(ctx context.Context, sigs ...os.Signal) context.Context
- func CurrentAccount(user *codefresh.User) (string, error)
- func DecorateErrorWithDocsLink(err error, link ...string) error
- func Die(err error, cause ...string)
- func Doc(doc string) string
- func EscapeAppsetFieldName(field string) string
- func GenerateIngressEventSourcePath(runtimeName string) string
- func IsIP(s string) bool
- func KubeContextNameByServer(server, kubeconfig string) (string, error)
- func KubeContexts(kubeconfig string) []kubeContext
- func KubeCurrentServer(kubeconfig string) (string, error)
- func KubeServerByContextName(contextName, kubeconfig string) (string, error)
- func OpenBrowserForGitLogin(ingressHost string, user string, account string) error
- func StringIndexOf(slice []string, val string) int
- func WithSpinner(ctx context.Context, msg ...string) func()
- type AsyncRunner
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckExistingContext ¶ added in v0.0.290
func ContextWithCancelOnSignals ¶
ContextWithCancelOnSignals returns a context that is canceled when one of the specified signals are received
func DecorateErrorWithDocsLink ¶ added in v0.0.187
func Die ¶
Die panics it the error is not nil. If a cause string is provided it will be displayed in the error message.
func Doc ¶
Doc returns a string where all the '<BIN>' are replaced with the binary name and all the '\t' are replaced with a uniformed indentation using space.
func EscapeAppsetFieldName ¶
func GenerateIngressEventSourcePath ¶ added in v0.0.278
func KubeContextNameByServer ¶ added in v0.0.283
func KubeContexts ¶ added in v0.0.290
func KubeContexts(kubeconfig string) []kubeContext
func KubeCurrentServer ¶ added in v0.0.290
func KubeServerByContextName ¶ added in v0.0.283
func OpenBrowserForGitLogin ¶ added in v0.0.293
func StringIndexOf ¶ added in v0.0.259
func WithSpinner ¶
WithSpinner create a spinner that prints a message and canceled if the given context is canceled or the returned stop function is called.
Types ¶
type AsyncRunner ¶
type AsyncRunner struct {
// contains filtered or unexported fields
}
func NewAsyncRunner ¶
func NewAsyncRunner(n int) *AsyncRunner
NewAsyncRunner initializes a new AsyncRunner that can run up to n async operations.
func (*AsyncRunner) Run ¶
func (ar *AsyncRunner) Run(f func() error)
Run runs another async operation
func (*AsyncRunner) Wait ¶
func (ar *AsyncRunner) Wait() error
Wait waits for all async operations to finish and returns an error if one of the async operations returned an error, otherwise, returns nil.