out

package
v1.15.15 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Stdout is exported for tests.
	Stdout io.Writer = os.Stdout
	// Stderr is exported for tests.
	Stderr io.Writer = os.Stderr
)

Functions

func AddPrefix

func AddPrefix(ctx context.Context, prefix string) context.Context

AddPrefix returns a context with the given prefix added to end of the existing prefix.

func Error

func Error(ctx context.Context, arg any)

Error prints the string with a red cross in front.

func Errorf added in v1.12.1

func Errorf(ctx context.Context, format string, args ...any)

Errorf prints the string in red to stderr.

func HasNewline

func HasNewline(ctx context.Context) bool

HasNewline returns the value of newline or the default (true).

func Notice added in v1.12.0

func Notice(ctx context.Context, arg any)

Notice prints the string with an exclamation mark.

func Noticef added in v1.12.1

func Noticef(ctx context.Context, format string, args ...any)

Noticef prints the string with an exclamation mark in front.

func OK added in v1.12.0

func OK(ctx context.Context, arg any)

OK prints the string with a green checkmark in front.

func OKf added in v1.12.1

func OKf(ctx context.Context, format string, args ...any)

OKf prints the string in with an OK checkmark in front.

func Prefix

func Prefix(ctx context.Context) string

Prefix returns the prefix or an empty string.

func Print

func Print(ctx context.Context, arg any)

Print prints the given string.

func Printf added in v1.12.1

func Printf(ctx context.Context, format string, args ...any)

Printf formats and prints the given string.

func Warning

func Warning(ctx context.Context, arg any)

Warning prints the string with a warning sign in front.

func Warningf added in v1.12.1

func Warningf(ctx context.Context, format string, args ...any)

Warningf prints the string in yellow to stderr and prepends a warning sign.

func WithNewline

func WithNewline(ctx context.Context, nl bool) context.Context

WithNewline returns a context with the flag value for newline set.

func WithPrefix

func WithPrefix(ctx context.Context, prefix string) context.Context

WithPrefix returns a context with the given prefix set.

Types

type Secret added in v1.12.5

type Secret string

Secret is a string wrapper for strings containing secrets. These won't be logged as long a GOPASS_DEBUG_LOG_SECRETS is not set.

func (Secret) SafeStr added in v1.12.5

func (s Secret) SafeStr() string

SafeStr always return "(elided)".

Jump to

Keyboard shortcuts

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