internalinterface

package
v1.3.13 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AcceptRejectOrSkipper

type AcceptRejectOrSkipper interface {
	IsAccept() bool
	IsReject() bool
	IsSkip() bool
}

type AddErrorer

type AddErrorer interface {
	AddError(err error)
}

type AddManyErrorer

type AddManyErrorer interface {
	// AddErrors no error then skip adding
	AddErrors(errs ...error)
}

type AddManyPointerErrorer

type AddManyPointerErrorer interface {
	// AddErrorsPtr no error then skip adding
	AddErrorsPtr(errs *[]error)
}

type AnyAttributesGetter

type AnyAttributesGetter interface {
	AnyAttributes() interface{}
}

type AnyAttributesReflectSetter

type AnyAttributesReflectSetter interface {
	ReflectSetAttributes(toPointer interface{}) error
}

type AnyValueGetter

type AnyValueGetter interface {
	Value() interface{}
}

type BaseErrorOrCollectionWrapper added in v1.2.1

type BaseErrorOrCollectionWrapper interface {
	ErrorHandler
	IsNullOrAnyNullChecker
	HasErrorChecker
	IsEmptyChecker
	ErrorStringGetter
	IsSuccessValidator
	IsInvalidChecker
	HasErrorOrHasAnyErrorChecker
	HasAnyIssues() bool
	IsDefined() bool

	// StringCompiler
	//
	//  error wrapper compiles to string with traces.
	StringCompiler
	ErrorHandler
	ErrorMessageHandler

	FullStringer
	CompiledErrorGetter
	FullStringWithTracesGetter
	FullStringWithTracesIfGetter
	ReferencesCompiledStringGetter
	CompiledErrorWithStackTracesGetter
	CompiledStackTracesStringGetter

	CompiledJsonErrorWithStackTracesGetter
	CompiledJsonStringWithStackTracesGetter

	FullStringSplitByNewLine() []string
	FullStringWithoutReferences() string

	MustBeEmptyError()

	// SerializeWithoutTracesGetter
	//
	//  Stack traces will be SKIPPED from the json bytes
	SerializeWithoutTracesGetter
	// Serialize
	//
	//  Should include stack traces
	Serialize() ([]byte, error)
	SerializeMust() []byte
	MarshalJSON() ([]byte, error)
	UnmarshalJSON(data []byte) error
	ErrorValueGetter

	Dispose()

	CompiledVoidLogger
	IsCollectionTyper

	ReflectSetTo(toPtr interface{}) error

	fmt.Stringer
}

type BaseErrorTyper

type BaseErrorTyper interface {
	NameWithNameEqualer
	NameValue() string
	IsValid() bool
	IsInvalid() bool
	IsRawValue(rawValue uint16) bool
	IsNoError() bool
	IsEmptyError() bool
	HasError() bool
	Combine(
		additionalMessage,
		varName string,
		val interface{},
	) string
	CombineNoRefs(
		additionalMessage string,
	) string
	Error(
		additionalMessage,
		varName string,
		val interface{},
	) error
	ErrorReferences(
		additionalMessage string,
		references ...interface{},
	) error
	ErrorNoRefs(
		additionalMessage string,
	) error
	Panic(
		additionalMessage,
		varName string,
		val interface{},
	)
	PanicNoRefs(
		additionalMessage string,
	)
	// CodeWithTypeName
	//
	// 	errconsts.ErrorCodeHyphenTypeNameFormat  = "(#%d - %s)"
	CodeWithTypeName() string
	TypeName() string
	CodeTypeNameWithCustomMessage(
		customMessage string,
	) string
	ReferencesCsv(
		additionalMessage string,
		references ...interface{},
	) string
	ReferencesLines(
		additionalMessage string,
		referencesLines ...interface{},
	) string
	ReferencesLinesError(
		additionalMessage string,
		referencesLines ...interface{},
	) error
	ReferencesCsvError(
		additionalMessage string,
		references ...interface{},
	) error
	ShortReferencesCsv(
		references ...interface{},
	) string
	ShortReferencesCsvError(
		references ...interface{},
	) error
	RawValue() uint16
	Value() uint16
	ValueInt16() int16
	ValueInt() int
	ValueUInt() uint
}

type BaseErrorWrapperCollectionDefiner

type BaseErrorWrapperCollectionDefiner interface {
	BaseErrorOrCollectionWrapper
	DyanmicLinqer
	CommonSliceDefiner
	LastIndex() int
	HasIndex(index int) bool

	AddErrorer
	AddManyErrorer
	AddManyPointerErrorer
	ConditionalErrorAdder

	HasError() bool
	IsEmpty() bool
	Length() int

	ToString(
		isIncludeStakeTraces,
		isIncludeHeader bool,
	) string
	ToStrings(
		isIncludeStakeTraces,
		isIncludeHeader bool,
	) []string

	Strings(isIncludeStakeTraces bool) []string

	String() string
	StringIf(isIncludeTraces bool) string
	StringStackTracesWithoutHeader() string
	DisplayStringWithTraces() string

	DisplayStringWithLimitTraces(limit int) string
	LogDisplayStringWithLimitTraces(limit int)
	FullStringWithTracesIfGetter

	StringWithoutHeader() string
	StringsWithoutHeader() []string

	LinesIf(
		isIncludeReferences bool,
	) []string

	StringsWithoutReferencePlusHeader() []string
	StringsIf(isIncludeStakeTraces bool) []string

	FullStrings() []string
	FullStringsWithTraces() []string
	FullStringsWithLimitTraces(limit int) []string

	Errors() []error
	CompiledErrors() []error
	CompiledErrorsWithStackTraces() []error

	GetAsError() error

	// HandleWithMsg Skip if no error.
	HandleWithMsg(msg string)
}

type BaseRawErrCollectionDefiner

type BaseRawErrCollectionDefiner interface {
	BaseErrorOrCollectionWrapper
	Add(err error)
	AddErrorer
	IsErrorsCollected
	AddWithTraceRef(
		err error,
		traces []string,
		referenceItem interface{},
	)
	AddWithCompiledTraceRef(
		err error,
		compiledTrace string,
		referenceItem interface{},
	)
	AddWithRef(
		err error,
		referenceItem interface{},
	)
	AddManyErrorer
	ConditionalErrorAdder
	// AddString
	//
	//  Empty string will be ignored
	AddString(
		message string,
	)
	AddStringSliceAsErr(
		errSliceStrings ...string,
	)
	CommonSliceDefiner
	StringUsingJoiner
	StringUsingJoinerAdditional(joiner, additionalMessage string) string
	CompiledErrorGetter
	CompiledErrorUsingJoiner(joiner string) error
	CompiledErrorUsingJoinerAdditionalMessage(joiner, additionalMessage string) error
	CompiledErrorUsingStackTraces(joiner string, stackTraces []string) error
	StringWithAdditionalMessage(additionalMessage string) string
}

type BaseRawErrorTyper

type BaseRawErrorTyper interface {
	String() string
	NameWithNameEqualer
	Combine(
		otherMsg string, reference interface{},
	) string
	TypesAttach(
		otherMsg string,
		reflectionTypes ...interface{},
	) string
	TypesAttachErr(
		otherMsg string,
		reflectionTypes ...interface{},
	) error
	SrcDestination(
		otherMsg string,
		srcName string, srcValue interface{},
		destinationName string, destinationValue interface{},
	) string
	SrcDestinationErr(
		otherMsg string,
		srcName string, srcValue interface{},
		destinationName string, destinationValue interface{},
	) error
	Error(otherMsg string, reference interface{}) error
	MsgCsvRef(
		otherMsg string,
		csvReferenceItems ...interface{},
	) string
	MsgCsvRefError(
		otherMsg string,
		csvReferenceItems ...interface{},
	) error
	ErrorRefOnly(reference interface{}) error
	Expecting(expecting, actual interface{}) error
	NoRef(otherMsg string) string
	ErrorNoRefs(otherMsg string) error
	HandleUsingPanic(otherMsg string, reference interface{})
}

type BasicErrWrapper

type BasicErrWrapper interface {
	BaseErrorOrCollectionWrapper
	IsReferencesEmptyChecker
	HasReferencesChecker
	IsEmptyErrorChecker
	HasCurrentErrorChecker

	TypeNameCodeMessage() string
	TypeNameWithCustomMessage(customMessage string) string
	RawErrorTypeValue() uint16
	TypeNamer
	CodeTypeNamer
	TypeCodeNameStringer

	IsErrorMessageEqual(msg string) bool
	// IsErrorMessage
	//
	// If error IsEmpty then returns false regardless
	IsErrorMessage(msg string, isCaseSensitive bool) bool
	ErrorValueGetter
	StringIf(isWithRef bool) string

	FullOrErrorMessageGetter
	JsonModelAnyGetter
	MarshalJSON() ([]byte, error)
	UnmarshalJSON(data []byte) error

	IsErrorEqualsChecker
}

BasicErrWrapper

IsEmpty:

Refers to no error for print or doesn't treat this as error.

Conditions (true):
    - if Wrapper nil, Or,
    - if Wrapper is StaticEmptyPtr, Or,
    - if Wrapper .errorType is IsNoError(), Or,
    - if Wrapper .currentError NOT nil and Wrapper .references.IsEmpty()

type ByteEnumNamer

type ByteEnumNamer interface {
	ToNamer
	ValueByte() byte
	Stringer
}

type ByteEnumValuer

type ByteEnumValuer interface {
	ByteValue() byte
}

type CategoryNameGetter

type CategoryNameGetter interface {
	CategoryName() string
}

type CategoryNameWithEqualer

type CategoryNameWithEqualer interface {
	CategoryNamer
	IsCategoryNameEqualer
}

type CategoryNamer

type CategoryNamer interface {
	CategoryName() string
}

type ChangesLogger

type ChangesLogger interface {
	LogChanges() error
}

type CodeTypeNamer added in v1.2.1

type CodeTypeNamer interface {
	CodeTypeName() string
}

type CommonSliceDefiner

type CommonSliceDefiner interface {
	Length() int
	IsEmpty() bool
	Clear()
	Dispose()
	String() string
}

type CompiledErrorGetter

type CompiledErrorGetter interface {
	CompiledError() error
}

type CompiledErrorWithStackTracesGetter

type CompiledErrorWithStackTracesGetter interface {
	CompiledErrorWithStackTraces() error
}

type CompiledJsonErrorWithStackTracesGetter added in v1.3.9

type CompiledJsonErrorWithStackTracesGetter interface {
	CompiledJsonErrorWithStackTraces() error
}

CompiledJsonErrorWithStackTracesGetter

returns error in json format with stack traces

type CompiledJsonStringWithStackTracesGetter added in v1.3.9

type CompiledJsonStringWithStackTracesGetter interface {
	CompiledJsonStringWithStackTraces() (jsonString string)
}

CompiledJsonStringWithStackTracesGetter

returns error in json format with stack traces

type CompiledStackTracesStringGetter

type CompiledStackTracesStringGetter interface {
	CompiledStackTracesString() string
}

type CompiledVoidLogger added in v1.2.1

type ConditionalErrorAdder

type ConditionalErrorAdder interface {
	// ConditionalAddError adds error if isAdd and error not nil.
	ConditionalAddError(
		isAdd bool,
		err error,
	)
}

type CountStateTracker

type CountStateTracker interface {
	IsSameStateUsingCount(
		currentCount int,
	) bool
	IsSameState() bool
	IsSuccessValidator
	HasChangesChecker
}

type DefaultsInjector

type DefaultsInjector interface {
	InjectDefaults() error
}

type DyanmicLinqer

type DyanmicLinqer interface {
	FirstDynamic() interface{}
	LastDynamic() interface{}
	FirstOrDefault()
	FirstOrDefaultCompiledError()
	FirstOrDefaultError() error
	FirstOrDefaultFullMessage() string
	LastOrDefaultCompiledError() error
	LastOrDefaultError() error
	LastOrDefaultFullMessage() string
	FirstOrDefaultDynamic() interface{}
	LastOrDefaultDynamic() interface{}
	SkipDynamic(skippingItemsCount int) interface{}
	TakeDynamic(takeDynamicItems int) interface{}
	LimitDynamic(limit int) interface{}
}

type DynamicChangeStateDetector

type DynamicChangeStateDetector interface {
	IsDynamicEqual(rawBytes []byte) bool
	DynamicDiffChangesGetter
	HasChangesChecker
	IsSuccessValidator
	ChangesLogger
	MustChangesLogger
}

type DynamicDiffChangesGetter

type DynamicDiffChangesGetter interface {
	DynamicDiffChanges() ([]byte, error)
}

type EntityTypeNameWithEqualer

type EntityTypeNameWithEqualer interface {
	EntityTypeNamer
	IsEntityTypeNameEqualer
}

type EntityTypeNamer

type EntityTypeNamer interface {
	EntityTypeName() string
}

type ErrorGetter

type ErrorGetter interface {
	Error() error
}

type ErrorHandler

type ErrorHandler interface {
	// HandleError
	//
	// Only call panic
	// if it has any error
	HandleError()
}

type ErrorMessageHandler

type ErrorMessageHandler interface {
	HandleErrorWithRefs(
		newMessage string,
		refVar,
		refVal interface{},
	)
	// HandleErrorWithMsg
	//
	//  Only call panic on has currentError
	HandleErrorWithMsg(newMessage string)
}

type ErrorStringGetter added in v1.2.1

type ErrorStringGetter interface {
	ErrorString() string
}

type ErrorValueGetter

type ErrorValueGetter interface {
	Value() error
}

type FatalTracesVoidLogger added in v1.2.1

type FatalTracesVoidLogger interface {
	LogFatalWithTraces()
}

type FatalVoidLogger added in v1.2.1

type FatalVoidLogger interface {
	LogFatal()
}

type FullOrErrorMessageGetter added in v1.2.1

type FullOrErrorMessageGetter interface {
	FullOrErrorMessage(
		isErrorMessage,
		isWithRef bool,
	) string
}

type FullStringWithTracesGetter

type FullStringWithTracesGetter interface {
	FullStringWithTraces() string
}

type FullStringWithTracesIfGetter

type FullStringWithTracesIfGetter interface {
	// FullStringWithTracesIf
	//
	//  Returns full string with stack traces if given as true
	//  Or, else just FullString returns
	FullStringWithTracesIf(isStackTraces bool) string
}

FullStringWithTracesIfGetter

Returns full string with stack traces if given as true
Or, else just FullString returns

type FullStringer added in v1.2.1

type FullStringer interface {
	FullString() string
}

type HasChangesChecker

type HasChangesChecker interface {
	HasChanges() bool
}

type HasCurrentErrorChecker added in v1.2.1

type HasCurrentErrorChecker interface {
	HasCurrentError() bool
}

type HasErrorChecker

type HasErrorChecker interface {
	HasError() bool
}

type HasErrorOrHasAnyErrorChecker

type HasErrorOrHasAnyErrorChecker interface {
	HasError() bool
	HasAnyError() bool
}

type HasReferencesChecker added in v1.2.1

type HasReferencesChecker interface {
	HasReferences() bool
}

type IdAsStringer

type IdAsStringer interface {
	IdString() string
}

type IdIntegerGetter

type IdIntegerGetter interface {
	IdInteger() int
}

type IdStringGetter

type IdStringGetter interface {
	Id() string
}

type IdStringerWithNamer

type IdStringerWithNamer interface {
	IdAsStringer
	ToNamer
}

type IdUnsignedIntegerGetter

type IdUnsignedIntegerGetter interface {
	Id() uint
}

type IdentifierGetter

type IdentifierGetter interface {
	Identifier() string
}

type IdentifierIntegerGetter

type IdentifierIntegerGetter interface {
	IdentifierInt() int
}

type IdentifierWithEqualer

type IdentifierWithEqualer interface {
	IdentifierGetter
	IsIdentifierEqualer
}

type IntegerIdGetter

type IntegerIdGetter interface {
	Id() int
}

type IsCategoryNameEqualer

type IsCategoryNameEqualer interface {
	IsCategoryName(categoryName string) bool
}

type IsCollectionTyper added in v1.3.3

type IsCollectionTyper interface {
	// IsCollectionType
	//
	//  returns true if current type is collection
	IsCollectionType() bool
}

IsCollectionTyper

returns true if current type is collection

type IsEmptyChecker

type IsEmptyChecker interface {
	IsEmpty() bool
}

type IsEmptyErrorChecker

type IsEmptyErrorChecker interface {
	IsEmptyError() bool
}

type IsEntityTypeNameEqualer

type IsEntityTypeNameEqualer interface {
	IsEntityTypeName(entityName string) bool
}

type IsErrorEqualsChecker

type IsErrorEqualsChecker interface {
	IsErrorEquals(err error) bool
	IsErrorMessageEqual(msg string) bool
	IsErrorMessage(msg string, isCaseSensitive bool) bool
	IsErrorMessageContains(
		msg string,
		isCaseSensitive bool,
	) bool
}

type IsErrorsCollected

type IsErrorsCollected interface {
	IsErrorsCollected(errorsItems ...error) bool
}

type IsFailedChecker

type IsFailedChecker interface {
	// IsFailed has error or any other issues, or alias for HasIssues or HasError
	IsFailed() bool
}

type IsIdEqualer

type IsIdEqualer interface {
	IsId(id string) bool
}

type IsIdUnsignedIntegerEqualer

type IsIdUnsignedIntegerEqualer interface {
	IsId(id uint) bool
}

type IsIdentifierEqualer

type IsIdentifierEqualer interface {
	IsIdentifier(identifier string) bool
}

type IsInvalidChecker

type IsInvalidChecker interface {
	IsInvalid() bool
}

type IsNameEqualer

type IsNameEqualer interface {
	IsNameEqual(name string) bool
}

type IsNullOrAnyNullChecker added in v1.2.1

type IsNullOrAnyNullChecker interface {
	IsNull() bool
	IsAnyNull() bool
}

type IsReferencesEmptyChecker added in v1.2.1

type IsReferencesEmptyChecker interface {
	IsReferencesEmpty() bool
}

type IsSuccessChecker

type IsSuccessChecker interface {
	// IsSuccess No error
	IsSuccess() bool
}

type IsSuccessValidator

type IsSuccessValidator interface {
	IsValidChecker
	IsSuccessChecker
	IsFailedChecker
}

type IsTypeNameEqualer

type IsTypeNameEqualer interface {
	IsTypeName(typeName string) bool
}

type IsValidChecker

type IsValidChecker interface {
	// IsValid similar or alias for IsSuccessChecker
	IsValid() bool
}

type JsonModelAnyGetter

type JsonModelAnyGetter interface {
	JsonModelAny() interface{}
}

type LogTypeChecker

type LogTypeChecker interface {
	IsSilent() bool
	HasNoLog() bool
	IsSkip() bool

	IsSuccess() bool

	IsInfo() bool
	IsTrace() bool
	IsDebug() bool
	IsError() bool
	IsFatal() bool
	IsPanic() bool
	IsInvalid() bool

	IsCustom() bool
	IsFile() bool
	HasPattern(pattern string) bool
	IsErrorLogical() bool
	IsErrorFatalLogical() bool
	IsErrorFatalPanicLogical() bool
}

type LogTypeCheckerBinder

type LogTypeCheckerBinder interface {
	LogTypeChecker
	AsLogTypeChecker() LogTypeChecker
}

type LoggerTyper

type LoggerTyper interface {
	SimpleEnumer
	LogTypeChecker
	IsLogNameEqual(name string) bool
	IsLogValueEqual(logVal byte) bool
}

type MustChangesLogger

type MustChangesLogger interface {
	LogChangesMust()
}

type MustDefaultsInjector

type MustDefaultsInjector interface {
	InjectDefaultsMust()
}

type NameWithNameEqualer

type NameWithNameEqualer interface {
	Namer
	IsNameEqualer
}

type Namer

type Namer interface {
	Name() string
}

type RawPayloadsGetter

type RawPayloadsGetter interface {
	RawPayloads() (payloads []byte, err error)
	RawPayloadsMust() (payloads []byte)
}

type ReferencesCompiledStringGetter added in v1.2.1

type ReferencesCompiledStringGetter interface {
	ReferencesCompiledString() string
}

type SerializeWithoutTracesGetter added in v1.2.1

type SerializeWithoutTracesGetter interface {
	SerializeWithoutTraces() ([]byte, error)
}

SerializeWithoutTracesGetter

Stack traces will be SKIPPED from the json bytes

type SimpleEnumer

type SimpleEnumer interface {
	ValueByte() byte
	ToNamer
	String() string
	TypeNamer
	IsValidChecker
	IsInvalidChecker
}

type StringCompiler added in v1.2.1

type StringCompiler interface {
	Compile() string
}

type StringUsingJoiner

type StringUsingJoiner interface {
	StringUsingJoiner(joiner string) string
}

type Stringer

type Stringer interface {
	String() string
}

type TableNamer

type TableNamer interface {
	TableName() string
}

type ToNamer

type ToNamer interface {
	Name() string
}

type ToNumberStringer

type ToNumberStringer interface {
	ToNumberString() string
}

type ToValueStringer

type ToValueStringer interface {
	Value() string
}

type TypeCodeNameStringer added in v1.2.1

type TypeCodeNameStringer interface {
	TypeCodeNameString() string
}

type TypeNameGetter

type TypeNameGetter interface {
	TypeName() string
}

type TypeNameWithEqualer

type TypeNameWithEqualer interface {
	TypeNameGetter
	IsTypeNameEqualer
}

type TypeNamer added in v1.2.1

type TypeNamer interface {
	TypeName() string
}

type TypenameStringGetter

type TypenameStringGetter interface {
	TypenameString() string
}

type UsernameGetter

type UsernameGetter interface {
	Username() string
}

type ValueGetter

type ValueGetter interface {
	ValueDynamic() interface{}
}

type ValueInt64Getter

type ValueInt64Getter interface {
	Value() int64
}

type ValueIntegerGetter

type ValueIntegerGetter interface {
	Value() int
}

type ValueReflectSetter

type ValueReflectSetter interface {
	ValueReflectSet(setterPtr interface{}) error
}

type ValueStringGetter

type ValueStringGetter interface {
	Value() string
}

type ValueStringsGetter

type ValueStringsGetter interface {
	Value() []string
}

type VoidIfLogger added in v1.2.1

type VoidIfLogger interface {
	LogIf(isLog bool)
}

type VoidLogger added in v1.2.1

type VoidLogger interface {
	// Log
	//
	//  Prints the compiled error message with all types
	//  only not fatal or panic
	Log()
}

type VoidTracesLogger added in v1.2.1

type VoidTracesLogger interface {
	// LogWithTraces
	//
	//  Prints the compiled error message with all types
	//  and stack-traces but not fatal or panic
	LogWithTraces()
}

type YesNoAcceptRejecter

type YesNoAcceptRejecter interface {
	YesNoAsker
	AcceptRejectOrSkipper
}

type YesNoAsker

type YesNoAsker interface {
	IsYes() bool
	IsNo() bool
	IsAsk() bool
	IsIndeterminate() bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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