notify

package
v0.51.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: MIT Imports: 4 Imported by: 1

Documentation

Index

Constants

View Source
const (
	NotifyInfo = iota
	NotifyWarning
	NotifyError
)

Variables

View Source
var Console = ConsoleWriter{
	DeviceIn:      os.Stdout,
	DeviceOut:     os.Stdout,
	StandardOut:   os.Stdout,
	StandardError: os.Stderr,
}
View Source
var Println = fmt.Println

Println is to inject a function that can report info,error and warning

Functions

func Debugf added in v0.9.2

func Debugf(format string, args ...interface{})

func Errorf

func Errorf(format string, args ...interface{})

func Infof

func Infof(format string, args ...interface{})

func Print

func Print(m Message)

func PrintBye added in v0.9.2

func PrintBye()

func PrintHighlighted added in v0.9.2

func PrintHighlighted(what string)

func PrintKeyValue added in v0.9.2

func PrintKeyValue(b io.Writer, k string, v interface{})

func PrintWelcome added in v0.9.2

func PrintWelcome(version string)

func Prompt added in v0.9.2

func Prompt() string

func RuntimePanic added in v0.9.2

func RuntimePanic(err error) error

func Warnf added in v0.9.2

func Warnf(format string, args ...interface{})

Types

type ConsoleWriter added in v0.9.2

type ConsoleWriter struct {
	DeviceIn      io.Writer
	DeviceOut     io.Writer
	StandardOut   io.Writer
	StandardError io.Writer
}

func (ConsoleWriter) Errorf added in v0.9.2

func (c ConsoleWriter) Errorf(format string, args ...interface{})

func (ConsoleWriter) Warnf added in v0.9.2

func (c ConsoleWriter) Warnf(format string, args ...interface{})

type Message

type Message interface {
	Message() string
	Type() int
}

func NewError added in v0.9.2

func NewError(err error) Message

func NewErrorf added in v0.9.2

func NewErrorf(format string, args ...interface{}) Message

func NewInfof added in v0.9.2

func NewInfof(format string, args ...interface{}) Message

func NewWarningf added in v0.9.2

func NewWarningf(format string, args ...interface{}) Message

type Notification

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

func (Notification) Message

func (n Notification) Message() string

func (Notification) Type

func (n Notification) Type() int

Jump to

Keyboard shortcuts

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