shared

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2021 License: Apache-2.0, Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Docker    *docker.Client
	DockerCLI *command.DockerCli
)
View Source
var (
	K8s       *kubernetes.Clientset
	K8sConfig *rest.Config
)

K8s defines shared client interface for Kubernetes cli.

View Source
var (
	// Logger is an instance of the shared logger tool.
	Logger *logging.Logger
	// ILogger is an instance of the interactive logger.
	ILogger *wow.Wow
)
View Source
var Helm helmclient.Client

Helm defines shared client interface for Helm cli.

View Source
var (
	ILogPrefixes map[ILogLevel]spin.Spinner
)

Functions

func DecorateWithInteractiveLog

func DecorateWithInteractiveLog(fn func() error, start, complete string) error

DecorateWithInteractiveLog wraps `fn` call into interactive logging with loading, displaying `start` message on loading, `complete` on successful end, and err return value on failure.

func DecorateWithInteractiveLogWithPersist

func DecorateWithInteractiveLogWithPersist(fn func() (level ILogLevel, msg string), start string)

DecorateWithInteractiveLogWithPersist wraps `fn` call into interactive logging with loading, displaying `start` message on loading and custom persist on end.

func DockerAPI

func DockerAPI() *api

func DockerBuildDrivers

func DockerBuildDrivers(ctxPath string) ([]build.DriverInfo, error)

func GetInstallationPath

func GetInstallationPath() (string, error)

GetInstallationPath determines cli binary installation path

func InitCore

func InitCore()

func ParseDockerResponse

func ParseDockerResponse(reader io.ReadCloser) (io.Reader, error)

func StartInteractiveConsole

func StartInteractiveConsole(ctx context.Context) console.File

Types

type ILogLevel

type ILogLevel int
const (
	ILogSuccess ILogLevel = iota
	ILogOk
	ILogError
	ILogWarning
	ILogInfo
)

Jump to

Keyboard shortcuts

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