eiamutil

package
v0.0.23 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2022 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Logger *logrus.Logger

Logger is the global logging instance.

Functions

func Confirm

func Confirm(vals map[string]string)

Confirm asks the user for confirmation before running a command.

func Contains

func Contains(values []string, val string) bool

Contains checks if val is an item in the values slice.

func DownloadAndExtract

func DownloadAndExtract(url, tmpDir, token string) error

func ExtractUnknownArgs

func ExtractUnknownArgs(flags *pflag.FlagSet, args []string) []string

ExtractUnknownArgs fetches unknown args passed to a command. This is used in the kubectl and gcloud commands to extract only the fields that should be used in the invoked command.

Modified from https://github.com/davidovich/summon/blob/master/cmd/run.go see https://github.com/spf13/pflag/pull/160 and https://github.com/spf13/cobra/issues/739 and https://github.com/spf13/pflag/pull/199

func FormatReason

func FormatReason(reason *string) error

FormatReason formats the reason field for logging visibility.

func GetLatestRelease

func GetLatestRelease(repoOwner, repoName, token string) (*github.RepositoryRelease, error)

func GetReleaseDownloadURL

func GetReleaseDownloadURL(r *github.RepositoryRelease, isPlugin bool) (string, error)

func MoveFile

func MoveFile(src, dst string) error

func NewJSONFormatter

func NewJSONFormatter() *logrus.JSONFormatter

NewJSONFormatter creates a new JSONFormatter logrus instance.

func NewLogger

func NewLogger() *logrus.Logger

NewLogger instantiates a new logging instance.

func NewRuntimeFormatter

func NewRuntimeFormatter() *rt.Formatter

NewRuntimeFormatter creates a new logrus formatter that contains extra debugging information.

func NewTextFormatter

func NewTextFormatter() *logrus.TextFormatter

NewTextFormatter creates a new TextFormatter logrus instance.

func SelectToken

func SelectToken(tokenConfig map[string]string) (string, error)

SelectToken prompts the user to select an existing Github personal access token.

func Uniq

func Uniq(a []string) []string

Uniq removes duplicate items from the input slice.

Types

This section is empty.

Jump to

Keyboard shortcuts

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