console

package
v0.0.0-...-34e0b2d Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AbnormalExit

func AbnormalExit(backupFinished bool, msg string, options ...ExitOption)

func AbnormalExitIf

func AbnormalExitIf(err error, backupFinished bool, options ...ExitOption)

func Error

func Error(msg string)

func ErrorExitIf

func ErrorExitIf(fail bool, backupFinished bool, msg string)

func Exit

func Exit(msg string, options ...ExitOption)

func ExitIf

func ExitIf(err error, options ...ExitOption)

func ExitWithOption

func ExitWithOption(opts ...ExitOption)

func NormalExit

func NormalExit(msg string, options ...ExitOption)

func NormalExitIf

func NormalExitIf(success bool, msg string, options ...ExitOption)

func Success

func Success(msg string)

func Warning

func Warning(msg string)

Types

type ErrorCode

type ErrorCode = int
const (
	NormalCode               ErrorCode = 0
	FailWithBackupUnfinished ErrorCode = 1
	FailButBackupFinished    ErrorCode = 2
	Unexpected               ErrorCode = 100
)

type ExitOption

type ExitOption func(c *exitConfig)

func AddCallbacks

func AddCallbacks(fns ...func()) ExitOption

func WithAbnormalExit

func WithAbnormalExit() ExitOption

func WithExitCode

func WithExitCode(code ErrorCode) ExitOption

func WithMsg

func WithMsg(msg string) ExitOption

Jump to

Keyboard shortcuts

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