register

package
v1.33.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Overview

Package register contains all the logic to print out `minikube start` in JSON

Index

Constants

This section is empty.

Variables

View Source
var (

	// GetUUID returns the UUID function to use
	GetUUID = randomID
)

Functions

func CloudEvent added in v1.17.1

func CloudEvent(log Log, data map[string]string) cloudevents.Event

CloudEvent creates a CloudEvent from a log object & associated data

func PrintDownload

func PrintDownload(artifact string)

PrintDownload prints a Download type in JSON format

func PrintDownloadProgress

func PrintDownloadProgress(artifact, progress string)

PrintDownloadProgress prints a DownloadProgress type in JSON format

func PrintError added in v1.12.2

func PrintError(err string)

PrintError prints an Error type in JSON format

func PrintErrorExitCode added in v1.12.2

func PrintErrorExitCode(err string, exitcode int, additionalArgs ...map[string]string)

PrintErrorExitCode prints an error in JSON format and includes an exit code

func PrintInfo

func PrintInfo(message string)

PrintInfo prints an Info type in JSON format

func PrintStep

func PrintStep(message string)

PrintStep prints a Step type in JSON format

func PrintWarning added in v1.12.2

func PrintWarning(warning string)

PrintWarning prints a Warning type in JSON format

func RecordError added in v1.12.2

func RecordError(err string)

RecordError records a Record type in JSON format

func RecordStep added in v1.12.2

func RecordStep(message string)

RecordStep records a Step type in JSON format

func SetEventLogPath added in v1.12.2

func SetEventLogPath(path string)

SetEventLogPath sets the path of an event log file

func SetOutputFile added in v1.12.2

func SetOutputFile(w io.Writer)

SetOutputFile sets the writer to emit all events to

Types

type Download

type Download struct {
	// contains filtered or unexported fields
}

Download will be used to notify the user that a download has begun

func NewDownload

func NewDownload(artifact string) *Download

NewDownload returns a new download type

func (*Download) Type

func (s *Download) Type() string

Type returns the cloud events compatible type of this struct

type DownloadProgress

type DownloadProgress struct {
	// contains filtered or unexported fields
}

DownloadProgress will be used to notify the user around the progress of a download

func NewDownloadProgress

func NewDownloadProgress(artifact, progress string) *DownloadProgress

NewDownloadProgress returns a new download progress type

func (*DownloadProgress) Type

func (s *DownloadProgress) Type() string

Type returns the cloud events compatible type of this struct

type Error

type Error struct {
	// contains filtered or unexported fields
}

Error will be used to notify the user of errors

func NewError added in v1.12.2

func NewError(err string) *Error

NewError returns a new Error type

func NewErrorExitCode added in v1.12.2

func NewErrorExitCode(err string, exitcode int, additionalData ...map[string]string) *Error

NewErrorExitCode returns an error that has an associated exit code

func (*Error) Type

func (s *Error) Type() string

Type returns the cloud events compatible type of this struct

type Info

type Info struct {
	// contains filtered or unexported fields
}

Info will be used to notify users of any extra info (env variables, options)

func NewInfo

func NewInfo(message string) *Info

NewInfo returns a new Info type

func (*Info) Type

func (s *Info) Type() string

Type returns the cloud events compatible type of this struct

type Log

type Log interface {
	Type() string
}

Log represents the different types of logs that can be output as JSON This includes: Step, Download, DownloadProgress, Warning, Info, Error

type RegStep

type RegStep string

RegStep is a type representing a distinct step of `minikube start`

const (
	// InitialSetup
	InitialSetup                      RegStep = "Initial Minikube Setup"
	SelectingDriver                   RegStep = "Selecting Driver"
	DownloadingArtifacts              RegStep = "Downloading Artifacts"
	StartingNode                      RegStep = "Starting Node"
	UpdatingDriver                    RegStep = "Updating Driver"
	PullingBaseImage                  RegStep = "Pulling Base Image"
	RunningLocalhost                  RegStep = "Running on Localhost"
	RunningRemotely                   RegStep = "Running Remotely"
	LocalOSRelease                    RegStep = "Local OS Release"
	CreatingContainer                 RegStep = "Creating Container"
	CreatingVM                        RegStep = "Creating VM"
	ConfiguringLHEnv                  RegStep = "Configuring Localhost Environment"
	PreparingKubernetes               RegStep = "Preparing Kubernetes"
	PreparingKubernetesCerts          RegStep = "Generating certificates"
	PreparingKubernetesControlPlane   RegStep = "Booting control plane"
	PreparingKubernetesBootstrapToken RegStep = "Configuring RBAC rules"
	ConfiguringCNI                    RegStep = "Configuring CNI"
	VerifyingKubernetes               RegStep = "Verifying Kubernetes"
	EnablingAddons                    RegStep = "Enabling Addons"
	Done                              RegStep = "Done"

	// Deleting
	Deleting RegStep = "Deleting"
	Purging  RegStep = "Puring home dir"

	Stopping  RegStep = "Stopping"
	PowerOff  RegStep = "PowerOff"
	Pausing   RegStep = "Pausing"
	Unpausing RegStep = "Unpausing"
)

If you add a new step here, please also add it to register.Reg registry inside the init() function

type Register

type Register struct {
	// contains filtered or unexported fields
}

Register holds all of the steps we could see in `minikube start` and keeps track of the current step

var Reg Register

Reg keeps track of all possible steps and the current step we are on

func (*Register) SetStep

func (r *Register) SetStep(s RegStep)

SetStep sets the current step

type Step

type Step struct {
	// contains filtered or unexported fields
}

Step represents a normal step in minikube execution

func NewStep

func NewStep(message string) *Step

NewStep returns a new step type

func (*Step) Type

func (s *Step) Type() string

Type returns the cloud events compatible type of this struct

type Warning

type Warning struct {
	// contains filtered or unexported fields
}

Warning will be used to notify the user of warnings

func NewWarning added in v1.12.2

func NewWarning(warning string) *Warning

NewWarning returns a new warning type

func (*Warning) Type

func (s *Warning) Type() string

Type returns the cloud events compatible type of this struct

Jump to

Keyboard shortcuts

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