gitlab.com/evatix-go/core@v1.3.55/coreinterface/errcoreinf/all-errors-related.go (about)

     1  package errcoreinf
     2  
     3  import (
     4  	"fmt"
     5  
     6  	"gitlab.com/evatix-go/core/coredata/corejson"
     7  	"gitlab.com/evatix-go/core/coreinterface"
     8  	"gitlab.com/evatix-go/core/coreinterface/enuminf"
     9  	"gitlab.com/evatix-go/core/internal/internalinterface"
    10  )
    11  
    12  type IsReferencesEmptyChecker interface {
    13  	internalinterface.IsReferencesEmptyChecker
    14  }
    15  
    16  type HasReferencesChecker interface {
    17  	internalinterface.HasReferencesChecker
    18  }
    19  
    20  type StringCompiler interface {
    21  	internalinterface.StringCompiler
    22  }
    23  
    24  type HasCurrentErrorChecker interface {
    25  	internalinterface.HasCurrentErrorChecker
    26  }
    27  
    28  type FullStringer interface {
    29  	internalinterface.FullStringer
    30  }
    31  
    32  type TypeNamer interface {
    33  	internalinterface.TypeNamer
    34  }
    35  
    36  type CodeTypeNamer interface {
    37  	internalinterface.CodeTypeNamer
    38  }
    39  
    40  type TypeCodeNameStringer interface {
    41  	internalinterface.TypeCodeNameStringer
    42  }
    43  
    44  type IsNullOrAnyNullChecker interface {
    45  	internalinterface.IsNullOrAnyNullChecker
    46  }
    47  
    48  type GetAsBasicWrapperGetter interface {
    49  	GetAsBasicWrapper() BasicErrWrapper
    50  }
    51  
    52  type GetAsBasicWrapperUsingTyperGetter interface {
    53  	GetAsBasicWrapperUsingTyper(errorTyper BasicErrorTyper) BasicErrWrapper
    54  }
    55  
    56  type StackTracer interface {
    57  	StackTracesJsonResult() *corejson.Result
    58  	StackTraces() string
    59  
    60  	// NewStackTraces
    61  	//
    62  	// returns new code stack (only) traces string
    63  	NewStackTraces(stackSkip int) string
    64  	// NewDefaultStackTraces
    65  	//
    66  	// returns new code stack (only) traces string
    67  	NewDefaultStackTraces() string
    68  	// NewStackTracesJsonResult
    69  	//
    70  	// returns new code stack (only) traces json
    71  	NewStackTracesJsonResult(stackSkip int) *corejson.Result
    72  	// NewDefaultStackTracesJsonResult
    73  	//
    74  	// returns new code stack (only) traces json
    75  	NewDefaultStackTracesJsonResult() *corejson.Result
    76  }
    77  
    78  type BaseErrorOrCollectionWrapper interface {
    79  	internalinterface.BaseErrorOrCollectionWrapper
    80  
    81  	// JsonResultWithoutTraces
    82  	//
    83  	// Mostly used for testing cases
    84  	JsonResultWithoutTraces() *corejson.Result
    85  
    86  	IsCollect(another BaseErrorOrCollectionWrapper) bool
    87  	IsCollectedAny(anotherItems ...BaseErrorOrCollectionWrapper) bool
    88  	IsCollectOn(isCollect bool, another BaseErrorOrCollectionWrapper) bool
    89  	IsEmptyAll(anotherItems ...BaseErrorOrCollectionWrapper) bool
    90  
    91  	GetAsBasicWrapperGetter
    92  	GetAsBasicWrapperUsingTyperGetter
    93  	StackTracer
    94  
    95  	coreinterface.ReflectSetter
    96  	corejson.Jsoner
    97  }
    98  
    99  type AddErrorer interface {
   100  	internalinterface.AddErrorer
   101  }
   102  
   103  type IsErrorsCollected interface {
   104  	internalinterface.IsErrorsCollected
   105  }
   106  
   107  type BaseRawErrCollectionDefiner interface {
   108  	internalinterface.BaseRawErrCollectionDefiner
   109  }
   110  
   111  type FullStringWithTracesGetter interface {
   112  	internalinterface.FullStringWithTracesGetter
   113  }
   114  
   115  type FullStringWithTracesIfGetter interface {
   116  	internalinterface.FullStringWithTracesIfGetter
   117  }
   118  
   119  // FullOrErrorMessageGetter
   120  //
   121  //  isErrorMessage : true will return only the error or else full string
   122  //  isWithRef : refers to include reference or not
   123  type FullOrErrorMessageGetter interface {
   124  	internalinterface.FullOrErrorMessageGetter
   125  }
   126  
   127  type ErrorStringGetter interface {
   128  	internalinterface.ErrorStringGetter
   129  }
   130  
   131  type ReferencesCompiledStringGetter interface {
   132  	internalinterface.ReferencesCompiledStringGetter
   133  }
   134  
   135  // ExplicitCodeValueNamer
   136  //
   137  // 	returns string in format "(Code - #%d) : %s"
   138  type ExplicitCodeValueNamer interface {
   139  	// ExplicitCodeValueName
   140  	//
   141  	// 	returns string in format "(Code - #%d) : %s"
   142  	ExplicitCodeValueName() string
   143  }
   144  
   145  type CodeTypeNameWithReferencer interface {
   146  	// CodeTypeNameWithReference
   147  	//
   148  	// 	returns string in format
   149  	// 	- "(#%d - %s - {%v})" : (error-code - name - referenceLine)
   150  	CodeTypeNameWithReference(
   151  		referenceLine string,
   152  	) string
   153  }
   154  
   155  type JsonModelAnyGetter interface {
   156  	JsonModelAny() interface{}
   157  }
   158  
   159  type CategoryNamer interface {
   160  	CategoryName() string
   161  }
   162  
   163  type BaseErrorTyper interface {
   164  	internalinterface.BaseErrorTyper
   165  	ExplicitCodeValueNamer
   166  	CodeTypeNameWithReferencer
   167  	JsonModelAnyGetter
   168  	CategoryNamer
   169  	coreinterface.AllSerializer
   170  	IsErrorTyperEqual(errTyper BaseErrorTyper) bool
   171  }
   172  
   173  type BaseErrorTypeGetter interface {
   174  	BaseErrorTyper() BaseErrorTyper
   175  }
   176  
   177  type BasicErrorTyperGetter interface {
   178  	BasicErrorTyper() BasicErrorTyper
   179  }
   180  
   181  type ErrTypeDetailDefiner interface {
   182  	TypenameString() string
   183  	TypeMessage() string
   184  	BaseErrorTypeGetter
   185  }
   186  
   187  type BasicErrorTyper interface {
   188  	BaseErrorTyper
   189  	enuminf.BasicEnumer
   190  
   191  	ErrTypeDetailDefiner() ErrTypeDetailDefiner
   192  	ErrorTypeAsBasicEnum() enuminf.BasicEnumer
   193  }
   194  
   195  type DyanmicLinqer interface {
   196  	internalinterface.DyanmicLinqer
   197  }
   198  
   199  type AddManyErrorer interface {
   200  	internalinterface.AddManyErrorer
   201  }
   202  
   203  type AddManyPointerErrorer interface {
   204  	internalinterface.AddManyPointerErrorer
   205  }
   206  
   207  type ConditionalErrorAdder interface {
   208  	internalinterface.ConditionalErrorAdder
   209  }
   210  
   211  type VarNamer interface {
   212  	VarName() string
   213  }
   214  
   215  type ErrWrapperLogger interface {
   216  	internalinterface.CompiledVoidLogger
   217  }
   218  
   219  type ValueDynamicGetter interface {
   220  	ValueDynamic() interface{}
   221  }
   222  
   223  type ValueStringGetter interface {
   224  	ValueString() string
   225  }
   226  
   227  type VariableValueStringGetter interface {
   228  	VariableValueString() (varName, value string)
   229  }
   230  
   231  type VariableValueDynamicGetter interface {
   232  	VariableValueDynamic() (varName string, value interface{})
   233  }
   234  
   235  type StringWithoutTyper interface {
   236  	StringWithoutType() string
   237  }
   238  
   239  type Referencer interface {
   240  	VarNamer
   241  	ValueDynamicGetter
   242  	VariableValueStringGetter
   243  	VariableValueDynamicGetter
   244  	ValueStringGetter
   245  	StringCompiler
   246  	StringWithoutTyper
   247  	FullStringer
   248  	fmt.Stringer
   249  	corejson.Jsoner
   250  	coreinterface.AllSerializer
   251  
   252  	IsEqualReferencer(ref Referencer) bool
   253  
   254  	coreinterface.ReflectSetter
   255  }
   256  
   257  type StringsGetter interface {
   258  	Strings() []string
   259  }
   260  
   261  type ReferencesListGetter interface {
   262  	ReferencesList() []Referencer
   263  }
   264  
   265  type ReferenceCollectionDefiner interface {
   266  	ReferencerCollection() []Referencer
   267  	coreinterface.HasAnyItemChecker
   268  	coreinterface.IsEmptyChecker
   269  	coreinterface.LengthGetter
   270  	coreinterface.CountGetter
   271  
   272  	AddVarVal(varName string, val interface{}) ReferenceCollectionDefiner
   273  	AddReferencer(ref Referencer) ReferenceCollectionDefiner
   274  	AddReferences(references ...Referencer) ReferenceCollectionDefiner
   275  
   276  	coreinterface.MapStringAnyGetter
   277  	coreinterface.MapStringStringGetter
   278  	coreinterface.AllSerializer
   279  	corejson.Jsoner
   280  
   281  	StringsGetter
   282  	fmt.Stringer
   283  	Compile() string
   284  
   285  	coreinterface.ReflectSetter
   286  	ReferencesListGetter
   287  
   288  	CloneNewDefiner() ReferenceCollectionDefiner
   289  }
   290  
   291  type BasicErrWrapper interface {
   292  	internalinterface.BasicErrWrapper
   293  	BaseErrorOrCollectionWrapper
   294  	ErrorTypeAsBasicErrorTyper() BasicErrorTyper
   295  	ReferencesCollection() ReferenceCollectionDefiner
   296  	coreinterface.ReflectSetter
   297  	ReferencesListGetter
   298  
   299  	IsBasicErrEqual(another BasicErrWrapper) bool
   300  	MergeNewErrInf(right BaseErrorOrCollectionWrapper) BaseErrorOrCollectionWrapper
   301  	MergeNewMessage(newMessage string) BaseErrorOrCollectionWrapper
   302  	CloneInterface() BasicErrWrapper
   303  }
   304  
   305  type CompiledBasicErrWrapper interface {
   306  	CompiledToGenericBasicErrWrapper() BasicErrWrapper
   307  	CompiledToBasicErrWrapper(errType BasicErrorTyper) BasicErrWrapper
   308  
   309  	CompiledToErrorWithTraces(errType BasicErrorTyper) error
   310  }
   311  
   312  type BaseErrorWrapperCollectionDefiner interface {
   313  	BaseErrorOrCollectionWrapper
   314  	internalinterface.BaseErrorWrapperCollectionDefiner
   315  
   316  	// LinesWithoutTraces
   317  	//
   318  	//  returns lines without traces
   319  	LinesWithoutTraces() []string
   320  
   321  	CompiledBasicErrWrapper
   322  	AddErrorUsingBasicType(errType BasicErrorTyper, err error) BaseErrorWrapperCollectionDefiner
   323  	AddBasicErrWrapper(basicErrWrapper BasicErrWrapper) BaseErrorWrapperCollectionDefiner
   324  }
   325  
   326  type VoidLogger interface {
   327  	internalinterface.VoidLogger
   328  }
   329  
   330  type VoidTracesLogger interface {
   331  	internalinterface.VoidTracesLogger
   332  }
   333  
   334  type FatalVoidLogger interface {
   335  	internalinterface.FatalVoidLogger
   336  }
   337  
   338  type FatalTracesVoidLogger interface {
   339  	internalinterface.FatalTracesVoidLogger
   340  }
   341  
   342  type VoidIfLogger interface {
   343  	internalinterface.VoidIfLogger
   344  }
   345  
   346  type CompiledVoidLogger interface {
   347  	internalinterface.CompiledVoidLogger
   348  }
   349  
   350  type ShouldBeErrorVerifier interface {
   351  	ShouldBeError(right interface{}) error
   352  }
   353  
   354  type ShouldBeMessageVerifier interface {
   355  	ShouldBe(right interface{}) string
   356  }
   357  
   358  type LeftShouldBeMessageVerifier interface {
   359  	ShouldBe(left, right interface{}) string
   360  }
   361  
   362  type LeftShouldBeErrorVerifier interface {
   363  	ShouldBeError(left, right interface{}) error
   364  }
   365  
   366  type CompleteSuccesser interface {
   367  	CompleteSuccess() BaseErrorOrCollectionWrapper
   368  }
   369  
   370  type MustCompleteSuccesser interface {
   371  	CompleteSuccessMust()
   372  }
   373  
   374  type CompleteFailurer interface {
   375  	CompleteFailure() BaseErrorOrCollectionWrapper
   376  }
   377  
   378  type MustCompleteFailurer interface {
   379  	CompleteFailureMust()
   380  }
   381  
   382  type GenericErrorCompiler interface {
   383  	BaseErrorTypeGetter
   384  
   385  	CompiledMessage() string
   386  	JsonString() string
   387  
   388  	Length() int
   389  	IsEmpty() bool
   390  	HasAnyItem() bool
   391  	HasAnyIssues() bool
   392  
   393  	CompileString() string
   394  	Serialize() ([]byte, error)
   395  
   396  	Format(format string) string
   397  	CompileError() error
   398  
   399  	corejson.Jsoner
   400  
   401  	ToGenericErr() BaseErrorOrCollectionWrapper
   402  	MustBeEmptier
   403  	CompiledVoidLogger
   404  
   405  	fmt.Stringer
   406  }
   407  
   408  type MustBeEmptier interface {
   409  	MustBeSuccess() bool
   410  	MustBeEmpty()
   411  	HandleError()
   412  }
   413  
   414  type CompleteSuccessJsoner interface {
   415  	CompleteSuccessJson() *corejson.Result
   416  }
   417  
   418  type CompleteFailureJsoner interface {
   419  	CompleteFailureJson() *corejson.Result
   420  }
   421  
   422  type ErrorCompleter interface {
   423  	CompleteReceiveError(completionTyper enuminf.CompletionStateTyper) error
   424  	CompleteUsingErrReceiveError(completionTyper enuminf.CompletionStateTyper) error
   425  
   426  	CompleteSuccesser
   427  	CompleteFailurer
   428  	MustCompleteSuccesser
   429  	MustCompleteFailurer
   430  
   431  	CompleteSuccessJsoner
   432  	CompleteFailureJsoner
   433  
   434  	Complete(completionTyper enuminf.CompletionStateTyper) BaseErrorOrCollectionWrapper
   435  	CompleteUsingErr(err error) BaseErrorOrCollectionWrapper
   436  	CompleteUsingErrWithTitle(title string, err error) BaseErrorOrCollectionWrapper
   437  	CompleteUsingBaseErrOrCollection(baseErrOrCollection BaseErrorOrCollectionWrapper) BaseErrorOrCollectionWrapper
   438  	CompleteUsingBasicErrWrapper(basicErrWrapper BasicErrWrapper) BaseErrorOrCollectionWrapper
   439  	CompleteUsingBaseErrorWrapperCollectionDefiner(baseErrOrCollection BaseErrorWrapperCollectionDefiner) BaseErrorOrCollectionWrapper
   440  	CompleteUsingBaseRawErrCollectionDefiner(baseErrOrCollection BaseRawErrCollectionDefiner) BaseErrorOrCollectionWrapper
   441  }