system

package
v0.5.61 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2024 License: MPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Red    = "\033[1;31m%s\033[0m"
	Green  = "\033[1;32m%s\033[0m"
	Yellow = "\033[1;33m%s\033[0m"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type System

type System interface {
	OpenBrowser(string) error
	Preflight() (string, error)
	CheckVersion(string) (string, bool)
	PromptInput(in io.Reader, out io.Writer, message string) string
}

System handles interactions between Shipyard and the OS

type SystemImpl

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

SystemImpl is a concrete implementation of the System interface

func (*SystemImpl) CheckVersion

func (b *SystemImpl) CheckVersion(current string) (string, bool)

CheckVersion checks the current version against the latest online version if an update is required the function returns a string with the upgrade text and a boolean value set to false. If no upgrade is reuquired then the boolean will be set to true and the string will be empty.

func (*SystemImpl) OpenBrowser

func (b *SystemImpl) OpenBrowser(uri string) error

OpenBrowser opens a URI in a new browser window

func (*SystemImpl) Preflight

func (b *SystemImpl) Preflight() (string, error)

Preflight checks that the required software is installed and is working correctly

func (*SystemImpl) PromptInput

func (b *SystemImpl) PromptInput(in io.Reader, out io.Writer, message string) string

PromptInput prompts the user for input in the CLI and returns the entered value

Jump to

Keyboard shortcuts

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