environment

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2023 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Ask

func Ask(prompt string) string

Ask can be used to get some input from the user. The user input will not be hidden (not secure).

func AskPassword

func AskPassword(prompt string) string

AskPassword asks password from the user and hides the input.

func Msg

func Msg(label, message string, colour color.Attribute, wrapWidth int) string

Msg returns with a string to print to a nicely formatted output with progress.

func PrintErrorMessage

func PrintErrorMessage(label, message string)

PrintErrorMessage displays an error message using Msg without newline at the end.

func PrintlnErrorMessage

func PrintlnErrorMessage(label, message string)

PrintlnErrorMessage displays an error message using Msg with newline at the end.

Types

type CaptureError added in v1.1.13

type CaptureError struct {
	Message  string
	Original string
}

CaptureError occurs when something went wrong with capturing io.

func (CaptureError) Error added in v1.1.13

func (e CaptureError) Error() string

type CapturingPassThroughWriter

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

CapturingPassThroughWriter is a writer that remembers data written to it and passes it to w.

func NewCapturingPassThroughWriter

func NewCapturingPassThroughWriter(w io.Writer) *CapturingPassThroughWriter

NewCapturingPassThroughWriter creates new CapturingPassThroughWriter.

func (*CapturingPassThroughWriter) Bytes

func (w *CapturingPassThroughWriter) Bytes() []byte

Bytes returns bytes written to the writer.

func (*CapturingPassThroughWriter) Write

func (w *CapturingPassThroughWriter) Write(d []byte) (int, error)

type ConfigurationError

type ConfigurationError struct {
	Message  string
	Original string
}

ConfigurationError occurs when something went wrong reading the configuration file.

func (ConfigurationError) Error

func (e ConfigurationError) Error() string

type Manager

type Manager struct {
	Namespace string
}

Manager is a central manager, mostly for configuration files, later others like cache, persistent storage, etc.

func NewManager

func NewManager(namespace string) Manager

NewManager creates a new Manager.

func (*Manager) ReadConfiguration

func (c *Manager) ReadConfiguration(data interface{}) error

ReadConfiguration reads and parses the configuration file.

Jump to

Keyboard shortcuts

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