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") 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 }}'") FactoryErrInternalFailedToClose = NewFactory( "errInternalFailedToClose", ErrorKindInternal, "failed to close object") FactoryErrWithData = NewFactory( "errWithData", ErrorKindInternalNotice, "{{ .key }}={{ .data }}") )
View Source
var ( FactoryErrServiceOperationFailed = NewFactory( "errServiceOperationFailed", ErrorKindInternal, "operation failed") "errServiceTemporarilyUnavailable", ErrorKindSystem, "system is temporarily unavailable") FactoryErrServiceIncorrectInputData = NewFactory( "errServiceIncorrectInputData", ErrorKindInternalNotice, "{{ .key }}={{ .data }} is incorrect") FactoryErrServiceEntityNotFound = NewFactory( "errServiceEntityNotFound", ErrorKindUser, "entity not found") FactoryErrServiceEntityVersionInvalid = NewFactory( "errServiceEntityVersionInvalid", ErrorKindUser, "entity version is invalid") FactoryErrServiceSwitchStatusRejected = NewFactory( "errServiceSwitchStatusRejected", ErrorKindUser, "switching from '{{ .statusFrom }}' to '{{ .statusTo }}' is rejected") FactoryErrServiceInvalidFile = NewFactory( "errServiceInvalidFile", ErrorKindUser, "file is invalid") )
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") )
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.