errwrappers

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2021 License: MIT Imports: 16 Imported by: 25

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collection

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

func Empty

func Empty() *Collection

func New

func New(capacity int) *Collection

func NewCap1 added in v0.3.0

func NewCap1() *Collection

func NewCap2 added in v0.3.0

func NewCap2() *Collection

func NewCap3 added in v0.3.0

func NewCap3() *Collection

func NewCap4 added in v0.3.0

func NewCap4() *Collection

func NewFromModel added in v0.4.0

func NewFromModel(
	model *CollectionModel,
) *Collection

func NewUsingCollections added in v0.3.3

func NewUsingCollections(
	errorCollectionOfCollections ...*Collection,
) *Collection

func NewUsingCollectionsPtr added in v0.3.3

func NewUsingCollectionsPtr(
	errorCollectionOfCollections *[]*Collection,
) *Collection

func NewUsingErrorWrappers added in v0.3.0

func NewUsingErrorWrappers(
	errWrappers ...*errorwrapper.Wrapper,
) *Collection

func NewUsingErrorWrappersPtr added in v0.3.0

func NewUsingErrorWrappersPtr(
	errWrappers *[]*errorwrapper.Wrapper,
	isMakeClone bool,
) *Collection

func NewUsingErrors added in v0.4.3

func NewUsingErrors(errs ...error) *Collection

func NewUsingErrorsPtr added in v0.4.3

func NewUsingErrorsPtr(errs *[]error) *Collection

func NewWithError added in v0.1.2

func NewWithError(capacity int, variation errtype.Variation, err error) *Collection

func NewWithErrorPtr added in v0.1.2

func NewWithErrorPtr(
	capacity int,
	variation errtype.Variation,
	err *error,
) *Collection

func NewWithItem

func NewWithItem(
	capacity int,
	variation errtype.Variation,
) *Collection

func NewWithMessage added in v0.3.1

func NewWithMessage(variation errtype.Variation, msg string) *Collection

func NewWithOnlyCapError added in v0.3.3

func NewWithOnlyCapError(capacity int, err error) *Collection

func NewWithOnlyError added in v0.1.2

func NewWithOnlyError(err error) *Collection

func NewWithType added in v0.3.1

func NewWithType(variation errtype.Variation) *Collection

func (*Collection) Add

func (collection *Collection) Add(variation errtype.Variation) *Collection

func (*Collection) AddCollections added in v0.2.6

func (collection *Collection) AddCollections(
	errCollections ...*Collection,
) *Collection

func (*Collection) AddCollectionsPtr added in v0.3.3

func (collection *Collection) AddCollectionsPtr(
	errCollections *[]*Collection,
) *Collection

func (*Collection) AddError added in v0.1.2

func (collection *Collection) AddError(err error) *Collection

AddError no error then skip adding

func (*Collection) AddErrors added in v0.4.3

func (collection *Collection) AddErrors(errs ...error) *Collection

AddErrors no error then skip adding

func (*Collection) AddErrorsPtr added in v0.4.3

func (collection *Collection) AddErrorsPtr(errs *[]error) *Collection

AddErrorsPtr no error then skip adding

func (*Collection) AddFuncs added in v0.4.9

func (collection *Collection) AddFuncs(
	errorType errtype.Variation,
	executeFunctions ...func() error,
) *Collection

AddFuncs if any func returns error then do not execute the others.

If func is nil or returns nil then continue further. If error not empty then returns don't continue further. If error is empty then continue further.

func (*Collection) AddRef added in v0.4.0

func (collection *Collection) AddRef(
	errType errtype.Variation,
	varName string,
	val interface{},
	err error,
) *Collection

func (*Collection) AddRefs added in v0.4.0

func (collection *Collection) AddRefs(
	errType errtype.Variation,
	refsCollection *refs.Collection,
	err error,
) *Collection

func (*Collection) AddScriptErrors added in v0.5.0

func (collection *Collection) AddScriptErrors(
	scriptType scripttype.Variant,
	scriptLines ...string,
) *errcmd.CmdOnce

AddScriptErrors adds error to the collection and returns the final result as errcmd.CmdOnce

func (*Collection) AddTypeError added in v0.4.0

func (collection *Collection) AddTypeError(
	variation errtype.Variation,
	err error,
) *Collection

AddTypeError Skip on empty or nil

func (*Collection) AddUsingMessages

func (collection *Collection) AddUsingMessages(
	variation errtype.Variation,
	messages ...string,
) *Collection

AddUsingMessages Same category multiple errorwrapper.New gets created for each message.

func (*Collection) AddUsingMsg

func (collection *Collection) AddUsingMsg(
	variation errtype.Variation,
	additionalMessage string,
) *Collection

func (*Collection) AddWithTypeErrorPtr added in v0.1.2

func (collection *Collection) AddWithTypeErrorPtr(
	variation errtype.Variation,
	err *error,
) *Collection

AddWithTypeErrorPtr Skip on empty or nil

func (*Collection) AddWrapper added in v0.2.5

func (collection *Collection) AddWrapper(
	errW errorwrapper.Wrapper,
) *Collection

AddWrapper Skip on empty

func (*Collection) AddWrapperFuncs added in v0.4.9

func (collection *Collection) AddWrapperFuncs(executeFunctions ...func() *errorwrapper.Wrapper) *Collection

AddWrapperFuncs if any func returns error then do not execute the others.

If func is nil or returns nil then continue further. If error not empty then returns don't continue further. If error is empty then continue further.

func (*Collection) AddWrapperPtr added in v0.2.5

func (collection *Collection) AddWrapperPtr(
	errW *errorwrapper.Wrapper,
) *Collection

AddWrapperPtr Skip on empty or nil

func (*Collection) AddWrappers added in v0.2.6

func (collection *Collection) AddWrappers(
	errWrappers ...*errorwrapper.Wrapper,
) *Collection

AddWrappers Skip on empty or nil

func (*Collection) AddWrappersPtr added in v0.2.5

func (collection *Collection) AddWrappersPtr(
	errWrappers *[]*errorwrapper.Wrapper,
) *Collection

AddWrappersPtr Skip on empty or nil

func (*Collection) Adds

func (collection *Collection) Adds(variations ...errtype.Variation) *Collection

Adds For each variation errorwrapper.New will be created and stored.

func (*Collection) AsJsonMarshaller added in v0.4.0

func (collection *Collection) AsJsonMarshaller() corejson.JsonMarshaller

func (*Collection) AsJsonParseSelfInjector added in v0.4.0

func (collection *Collection) AsJsonParseSelfInjector() corejson.JsonParseSelfInjector

func (*Collection) AsJsoner added in v0.4.0

func (collection *Collection) AsJsoner() corejson.Jsoner

func (*Collection) ConditionalAddError added in v0.4.9

func (collection *Collection) ConditionalAddError(
	isAdd bool,
	err error,
) *Collection

ConditionalAddError adds error if isAdd and error not nil.

func (*Collection) ConditionalAddErrorWrapper added in v0.4.9

func (collection *Collection) ConditionalAddErrorWrapper(
	isAdd bool,
	errWrapper *errorwrapper.Wrapper,
) *Collection

ConditionalAddErrorWrapper adds error if isAdd and error not nil.

func (*Collection) Dispose

func (collection *Collection) Dispose()

Dispose After dispose nothing will work, everything be removed from memory.

func (*Collection) GetAsError

func (collection *Collection) GetAsError() error

func (*Collection) GetAsErrorWrapper added in v0.3.4

func (collection *Collection) GetAsErrorWrapper() errorwrapper.Wrapper

func (*Collection) GetAsErrorWrapperPtr added in v0.3.4

func (collection *Collection) GetAsErrorWrapperPtr() *errorwrapper.Wrapper

func (*Collection) HandleError added in v0.2.5

func (collection *Collection) HandleError()

HandleError Skip if no error. Or else panics.

func (*Collection) HandleWithMsg

func (collection *Collection) HandleWithMsg(msg string)

HandleWithMsg Skip if no error.

func (*Collection) HasError added in v0.2.5

func (collection *Collection) HasError() bool

func (*Collection) IsChainCmdSuccess added in v0.5.0

func (collection *Collection) IsChainCmdSuccess(
	scriptType scripttype.Variant,
	scriptLines ...string,
) (isSuccess bool)

IsChainCmdSuccess if any script is failed to run then don't continue others

Errors will be wrapped and added to the collection

func (*Collection) IsCmdSuccess added in v0.5.0

func (collection *Collection) IsCmdSuccess(
	scriptType scripttype.Variant,
	scriptLines ...string,
) bool

IsCmdSuccess adds error to the collection and returns the final returns bool

func (*Collection) IsEmpty

func (collection *Collection) IsEmpty() bool

func (*Collection) Items added in v0.2.5

func (collection *Collection) Items() *[]*errorwrapper.Wrapper

func (*Collection) ItemsNonPtr added in v0.2.5

func (collection *Collection) ItemsNonPtr() *[]errorwrapper.Wrapper

func (*Collection) Json added in v0.4.0

func (collection *Collection) Json() *corejson.Result

func (*Collection) JsonModel added in v0.4.0

func (collection *Collection) JsonModel() *CollectionModel

func (*Collection) JsonModelAny added in v0.4.0

func (collection *Collection) JsonModelAny() interface{}

func (*Collection) JsonParseSelfInject added in v0.4.0

func (collection *Collection) JsonParseSelfInject(
	jsonResult *corejson.Result,
) error

func (*Collection) Length

func (collection *Collection) Length() int

func (*Collection) List

func (collection *Collection) List() *[]*errorwrapper.Wrapper

func (*Collection) Log

func (collection *Collection) Log()

Log Skip if no error. Or else log prints.

func (*Collection) LogFatal

func (collection *Collection) LogFatal()

LogFatal Skip if no error. Or else log fatal.

func (*Collection) MarshalJSON added in v0.4.0

func (collection *Collection) MarshalJSON() ([]byte, error)

func (*Collection) ParseInjectUsingJson added in v0.4.0

func (collection *Collection) ParseInjectUsingJson(
	jsonResult *corejson.Result,
) (*Collection, error)

func (*Collection) ParseInjectUsingJsonMust added in v0.4.0

func (collection *Collection) ParseInjectUsingJsonMust(
	jsonResult *corejson.Result,
) *Collection

Panic if error

func (*Collection) String

func (collection *Collection) String() string

func (*Collection) StringPtr

func (collection *Collection) StringPtr() *string

func (*Collection) Strings

func (collection *Collection) Strings() []string

func (*Collection) UnmarshalJSON added in v0.4.0

func (collection *Collection) UnmarshalJSON(data []byte) error

type CollectionModel added in v0.4.0

type CollectionModel struct {
	Wrappers *[]*errorwrapper.Wrapper
}

func NewDataModel added in v0.4.0

func NewDataModel(
	collection *Collection,
) *CollectionModel

Jump to

Keyboard shortcuts

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