errwrappers

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2021 License: MIT Imports: 17 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) AddAllFunctions added in v0.5.2

func (collection *Collection) AddAllFunctions(
	executeFunctions ...func() *errorwrapper.Wrapper,
) *Collection

AddAllFunctions 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 collects and continues Doesn't STOP until all run.

func (*Collection) AddAnyFunctions added in v0.5.2

func (collection *Collection) AddAnyFunctions(
	successExecute ...func() *errorwrapper.Wrapper,
) *Collection

AddAnyFunctions will execute until founds a error if found any error then remaining ones will NOT run Having nil in func will continue further.

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) AddErrorFunctions added in v0.5.2

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

AddErrorFunctions 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) 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) AddIf added in v0.5.2

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

func (*Collection) AddOnlyRefs added in v0.5.2

func (collection *Collection) AddOnlyRefs(
	variation errtype.Variation,
	refValues ...ref.Value,
) *Collection

func (*Collection) AddPathIssue added in v0.5.2

func (collection *Collection) AddPathIssue(
	variation errtype.Variation,
	err error,
	pathLocation string,
) *Collection

AddPathIssue if no error then doesn't add to the collection.

func (*Collection) AddPathIssueMessages added in v0.5.2

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

AddPathIssueMessages if no error then doesn't add to the collection.

func (*Collection) AddRef added in v0.4.0

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

func (*Collection) AddRef2 added in v0.5.2

func (collection *Collection) AddRef2(
	variation errtype.Variation,
	var1 string, val1 interface{},
	var2 string, val2 interface{},
	messages ...string,
) *Collection

AddRef2 if messages empty then nothing added

func (*Collection) AddRefs added in v0.4.0

func (collection *Collection) AddRefs(
	variation errtype.Variation,
	err error,
	refValues ...ref.Value,
) *Collection

func (*Collection) AddRefsCollection added in v0.5.2

func (collection *Collection) AddRefsCollection(
	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) 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) ExecuteCollectFuncIf added in v0.5.2

func (collection *Collection) ExecuteCollectFuncIf(
	isExecute bool,
	f func() *errorwrapper.Wrapper,
) *Collection

ExecuteCollectFuncIf if true then executes the function and add to error collection if function returns error

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

ParseInjectUsingJsonMust 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