effects

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Ok exitType = iota
	Error
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Effect

type Effect interface {
	Run() error
}

Effect a side effect

func NewExitErr

func NewExitErr() Effect

NewExitErr exit with error code

func NewExitErrMsg

func NewExitErrMsg(err error) Effect

NewExitErrMsg exit with error code and print a red colored message with error:

func NewExitOk

func NewExitOk() Effect

NewExitOk exit with success code

func NewExitOkMsg

func NewExitOkMsg(message string) Effect

NewExitOkMsg exit with success code and print a message

type ExitWithMsg

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

func (ExitWithMsg) Run

func (exit ExitWithMsg) Run() error

type ExitWithoutMsg

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

func (ExitWithoutMsg) Run

func (exit ExitWithoutMsg) Run() error

Jump to

Keyboard shortcuts

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