maybedoer

package
Version: v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2020 License: CC0-1.0 Imports: 0 Imported by: 0

Documentation

Overview

Package maybedoer contains a pipeline of actions that might fail. If any action in the chain fails, no further actions take place and the error becomes the pipeline error.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Impl

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

Impl sequences a set of actions to be performed via calls to `Maybe` such that any previous error prevents new actions from being performed.

This is, conceptually, just a go-ification of the Maybe monad.

func (*Impl) Error

func (c *Impl) Error() error

Error returns the first error encountered in the Error chain.

func (*Impl) Maybe

func (c *Impl) Maybe(f func() error)

Maybe performs `f` if no previous call to a Maybe'd action resulted in an error

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto