2020-04-04 08:36:52 +00:00
|
|
|
package dynfunc
|
2020-03-29 13:00:22 +00:00
|
|
|
|
|
|
|
// cerr allows you to create constant "const" error with type boxing.
|
|
|
|
type cerr string
|
|
|
|
|
|
|
|
// Error implements the error builtin interface.
|
|
|
|
func (err cerr) Error() string {
|
|
|
|
return string(err)
|
|
|
|
}
|
|
|
|
|
|
|
|
// ErrHandlerNotFunc - handler is not a func
|
|
|
|
const ErrHandlerNotFunc = cerr("handler must be a func")
|
|
|
|
|
|
|
|
// ErrNoServiceForHandler - no service matching this handler
|
|
|
|
const ErrNoServiceForHandler = cerr("no service found for this handler")
|
|
|
|
|
|
|
|
// ErrMissingHandlerArgumentParam - missing params arguments for handler
|
2020-03-29 14:58:53 +00:00
|
|
|
const ErrMissingHandlerArgumentParam = cerr("missing handler argument : parameter struct")
|
2020-03-29 13:00:22 +00:00
|
|
|
|
2020-04-04 08:02:48 +00:00
|
|
|
// ErrUnexpectedInput - input argument is not expected
|
|
|
|
const ErrUnexpectedInput = cerr("unexpected input struct")
|
|
|
|
|
2020-03-29 13:00:22 +00:00
|
|
|
// ErrMissingHandlerOutput - missing output for handler
|
|
|
|
const ErrMissingHandlerOutput = cerr("handler must have at least 1 output")
|
|
|
|
|
|
|
|
// ErrMissingHandlerOutputError - missing error output for handler
|
|
|
|
const ErrMissingHandlerOutputError = cerr("handler must have its last output of type api.Error")
|
|
|
|
|
|
|
|
// ErrMissingRequestArgument - missing request argument for handler
|
|
|
|
const ErrMissingRequestArgument = cerr("handler first argument must be of type api.Request")
|
|
|
|
|
|
|
|
// ErrMissingParamArgument - missing parameters argument for handler
|
|
|
|
const ErrMissingParamArgument = cerr("handler second argument must be a struct")
|
|
|
|
|
2020-03-29 17:22:43 +00:00
|
|
|
// ErrUnexportedName - argument is unexported in struct
|
2020-03-29 17:13:07 +00:00
|
|
|
const ErrUnexportedName = cerr("unexported name")
|
|
|
|
|
2020-03-29 13:00:22 +00:00
|
|
|
// ErrMissingParamOutput - missing output argument for handler
|
2020-03-29 14:58:53 +00:00
|
|
|
const ErrMissingParamOutput = cerr("handler first output must be a *struct")
|
2020-03-29 13:00:22 +00:00
|
|
|
|
|
|
|
// ErrMissingParamFromConfig - missing a parameter in handler struct
|
|
|
|
const ErrMissingParamFromConfig = cerr("missing a parameter from configuration")
|
|
|
|
|
|
|
|
// ErrMissingOutputFromConfig - missing a parameter in handler struct
|
|
|
|
const ErrMissingOutputFromConfig = cerr("missing a parameter from configuration")
|
|
|
|
|
|
|
|
// ErrWrongParamTypeFromConfig - a configuration parameter type is invalid in the handler param struct
|
2020-03-29 14:58:53 +00:00
|
|
|
const ErrWrongParamTypeFromConfig = cerr("invalid struct field type")
|
2020-03-29 13:00:22 +00:00
|
|
|
|
|
|
|
// ErrMissingHandlerErrorOutput - missing handler output error
|
|
|
|
const ErrMissingHandlerErrorOutput = cerr("last output must be of type api.Error")
|