Documentation ¶
Index ¶
- Variables
- type UsecaseHelper
- func (h *UsecaseHelper) Caller(skip int) *UsecaseHelper
- func (h *UsecaseHelper) IsNotFoundError(err error) bool
- func (h *UsecaseHelper) WrapErrorEntityFailed(err error, entityName string, entityData any) error
- func (h *UsecaseHelper) WrapErrorEntityNotFoundOrFailed(err error, entityName string, entityData any) error
- func (h *UsecaseHelper) WrapErrorFailed(err error, source string) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( FactoryErrHttpResponseParseData = NewFactory( "errHttpResponseParseData", ErrorKindInternal, "response data is not valid") FactoryErrHttpFileUpload = NewFactory( "errHttpFileUpload", ErrorKindUser, "the file with the specified key '{{ .key }}' was not uploaded") FactoryErrHttpMultipartFormFile = NewFactory( "errHttpMultipartFormFile", ErrorKindSystem, "the file with the specified key '{{ .key }}' cannot be processed") "errHttpClientUnauthorized", ErrorKindUser, "401. client is unauthorized") FactoryErrHttpAccessForbidden = NewFactory( "errHttpAccessForbidden", ErrorKindUser, "403. access forbidden") FactoryErrHttpResourceNotFound = NewFactory( "errHttpResourceNotFound", ErrorKindUser, "404. resource not found") FactoryErrHttpRequestParseData = NewFactory( "errHttpRequestParseData", ErrorKindUser, "request body is not valid") FactoryErrHttpRequestParseParam = NewFactory( "errHttpRequestParseParam", ErrorKindUser, "request param with key '{{ .key }}' of type '{{ .type }}' contains incorrect value '{{ .value }}'") FactoryErrHttpRequestParamEmpty = NewFactory( "errHttpRequestParamEmpty", ErrorKindUser, "request param with key '{{ .key }}' is empty'") FactoryErrHttpRequestParamMax = NewFactory( "errHttpRequestParamMax", ErrorKindUser, "request param with key '{{ .key }}' contains value greater then max '{{ .max }}'") FactoryErrHttpRequestParamLenMax = NewFactory( "errHttpRequestParamLenMax", ErrorKindUser, "request param with key '{{ .key }}' has value length greater then max '{{ .maxLength }}' characters") )
View Source
var ( FactoryErrInternal = NewFactory( ErrorCodeInternal, ErrorKindInternal, "internal server error") FactoryErrInternalNotice = NewFactory( ErrorCodeInternal, ErrorKindInternalNotice, "internal server error") FactoryErrInternalNilPointer = NewFactory( "errInternalNilPointer", ErrorKindInternal, "nil pointer") FactoryErrInternalTypeAssertion = NewFactory( "errInternalTypeAssertion", ErrorKindInternal, "invalid type '{{ .type }}' assertion (value: {{ .value }})") FactoryErrInternalInvalidType = NewFactory( "errInternalInvalidType", ErrorKindInternal, "invalid type '{{ .currentType }}', expected: '{{ .expectedType }}'") FactoryErrInternalFailedToOpen = NewFactory( "errInternalFailedToOpen", ErrorKindInternal, "failed to open object") FactoryErrInternalFailedToClose = NewFactory( "errInternalFailedToClose", ErrorKindInternal, "failed to close object") FactoryErrWithData = NewFactory( "errWithData", ErrorKindInternalNotice, "{{ .key }}={{ .data }}") )
View Source
var ( FactoryErrStorageConnectionIsAlreadyCreated = NewFactory( "errStorageConnectionIsAlreadyCreated", ErrorKindInternal, "connection '{{ .name }}' is already created") FactoryErrStorageConnectionIsNotOpened = NewFactory( "errStorageConnectionIsNotOpened", ErrorKindInternal, "connection '{{ .name }}' is not opened") FactoryErrStorageConnectionFailed = NewFactory( "errStorageConnectionFailed", ErrorKindSystem, "connection '{{ .name }}' is failed") FactoryErrStorageQueryFailed = NewFactory( "errStorageQueryFailed", ErrorKindInternal, "query is failed") FactoryErrStorageFetchDataFailed = NewFactory( "errStorageFetchDataFailed", ErrorKindInternal, "fetching data is failed") FactoryErrStorageNoRowFound = NewFactory( "errStorageNoRowFound", ErrorKindInternalNotice, "no row found") FactoryErrStorageRowsNotAffected = NewFactory( "errStorageRowsNotAffected", ErrorKindInternalNotice, "rows not affected") )
View Source
var ( FactoryErrUseCaseOperationFailed = NewFactory( "errUseCaseOperationFailed", ErrorKindInternal, "operation failed") "errUseCaseTemporarilyUnavailable", ErrorKindSystem, "system is temporarily unavailable") FactoryErrUseCaseIncorrectInputData = NewFactory( "errUseCaseIncorrectInputData", ErrorKindInternalNotice, "{{ .key }}={{ .data }} is incorrect") FactoryErrUseCaseEntityNotFound = NewFactory( "errUseCaseEntityNotFound", ErrorKindUser, "entity not found") FactoryErrUseCaseEntityVersionInvalid = NewFactory( "errUseCaseEntityVersionInvalid", ErrorKindUser, "entity version is invalid") FactoryErrUseCaseSwitchStatusRejected = NewFactory( "errUseCaseSwitchStatusRejected", ErrorKindUser, "switching from '{{ .statusFrom }}' to '{{ .statusTo }}' is rejected") FactoryErrUseCaseInvalidFile = NewFactory( "errUseCaseInvalidFile", ErrorKindUser, "file is invalid") )
Functions ¶
This section is empty.
Types ¶
type UsecaseHelper ¶ added in v0.13.0
type UsecaseHelper struct {
// contains filtered or unexported fields
}
func NewUsecaseHelper ¶ added in v0.13.0
func NewUsecaseHelper() *UsecaseHelper
func (*UsecaseHelper) Caller ¶ added in v0.13.0
func (h *UsecaseHelper) Caller(skip int) *UsecaseHelper
func (*UsecaseHelper) IsNotFoundError ¶ added in v0.13.0
func (h *UsecaseHelper) IsNotFoundError(err error) bool
func (*UsecaseHelper) WrapErrorEntityFailed ¶ added in v0.13.0
func (h *UsecaseHelper) WrapErrorEntityFailed(err error, entityName string, entityData any) error
func (*UsecaseHelper) WrapErrorEntityNotFoundOrFailed ¶ added in v0.13.0
func (h *UsecaseHelper) WrapErrorEntityNotFoundOrFailed(err error, entityName string, entityData any) error
func (*UsecaseHelper) WrapErrorFailed ¶ added in v0.13.0
func (h *UsecaseHelper) WrapErrorFailed(err error, source string) error
Click to show internal directories.
Click to hide internal directories.