result

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 20, 2020 License: GPL-3.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Wrap

func Wrap(fn func())

Wrap a function with recover and do nothing.

func WrapCallback

func WrapCallback(fn func(), handle func(x interface{}))

Types

type Result

type Result struct {
	Ok  interface{}
	Err error
}

func (*Result) And

func (r *Result) And(res *Result) *Result

func (*Result) AndThen

func (r *Result) AndThen(fn func(interface{}) *Result) *Result

func (*Result) IsErr

func (r *Result) IsErr() bool

func (*Result) IsOk

func (r *Result) IsOk() bool

func (*Result) Map

func (r *Result) Map(fn func(interface{}) interface{}) *Result

func (*Result) MapErr

func (r *Result) MapErr(fn func(err error) error) *Result

func (*Result) Or

func (r *Result) Or(res *Result) *Result

func (*Result) OrElse

func (r *Result) OrElse(fn func(err error) *Result) *Result

func (*Result) Unwrap

func (r *Result) Unwrap() interface{}

func (*Result) UnwrapOr

func (r *Result) UnwrapOr(v interface{}) interface{}

func (*Result) UnwrapOrElse

func (r *Result) UnwrapOrElse(fn func(err error) interface{}) interface{}

Jump to

Keyboard shortcuts

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