2020-03-14 14:24:17 +00:00
|
|
|
package config
|
|
|
|
|
2020-03-21 13:19:14 +00:00
|
|
|
// cerr allows you to create constant "const" error with type boxing.
|
|
|
|
type cerr string
|
2020-03-14 14:24:17 +00:00
|
|
|
|
2020-03-21 13:19:14 +00:00
|
|
|
func (err cerr) Error() string {
|
2020-03-14 14:24:17 +00:00
|
|
|
return string(err)
|
|
|
|
}
|
|
|
|
|
2020-04-04 13:39:00 +00:00
|
|
|
// errRead - read error
|
2020-04-04 12:34:20 +00:00
|
|
|
const errRead = cerr("cannot read config")
|
2020-03-14 14:24:17 +00:00
|
|
|
|
2020-04-04 13:39:00 +00:00
|
|
|
// errUnknownMethod - unknown http method
|
2020-04-04 12:34:20 +00:00
|
|
|
const errUnknownMethod = cerr("unknown HTTP method")
|
2020-03-14 14:24:17 +00:00
|
|
|
|
2020-04-04 13:39:00 +00:00
|
|
|
// errFormat - invalid format
|
2020-04-04 12:34:20 +00:00
|
|
|
const errFormat = cerr("invalid config format")
|
2020-03-14 14:24:17 +00:00
|
|
|
|
2020-04-04 13:39:00 +00:00
|
|
|
// errPatternCollision - collision between 2 services' patterns
|
2020-04-04 12:34:20 +00:00
|
|
|
const errPatternCollision = cerr("pattern collision")
|
2020-03-14 14:24:17 +00:00
|
|
|
|
2020-04-04 13:39:00 +00:00
|
|
|
// errInvalidPattern - malformed service pattern
|
|
|
|
const errInvalidPattern = cerr("malformed service path: must begin with a '/' and not end with")
|
2020-03-14 14:24:17 +00:00
|
|
|
|
2020-04-04 13:39:00 +00:00
|
|
|
// errInvalidPatternBraceCapture - invalid brace capture
|
|
|
|
const errInvalidPatternBraceCapture = cerr("invalid uri parameter")
|
2020-03-14 14:24:17 +00:00
|
|
|
|
2020-04-04 13:39:00 +00:00
|
|
|
// errUnspecifiedBraceCapture - missing path brace capture
|
|
|
|
const errUnspecifiedBraceCapture = cerr("missing uri parameter")
|
2020-03-14 14:24:17 +00:00
|
|
|
|
2020-04-04 13:39:00 +00:00
|
|
|
// errUndefinedBraceCapture - missing capturing brace definition
|
|
|
|
const errUndefinedBraceCapture = cerr("missing uri parameter definition")
|
2020-03-29 12:18:05 +00:00
|
|
|
|
2020-04-04 13:39:00 +00:00
|
|
|
// errMandatoryRename - capture/query parameters must be renamed
|
|
|
|
const errMandatoryRename = cerr("uri and query parameters must be renamed")
|
2020-03-16 09:56:26 +00:00
|
|
|
|
2020-04-04 12:34:20 +00:00
|
|
|
// errMissingDescription - a service is missing its description
|
|
|
|
const errMissingDescription = cerr("missing description")
|
2020-03-14 14:24:17 +00:00
|
|
|
|
2020-04-04 13:39:00 +00:00
|
|
|
// errIllegalOptionalURIParam - uri parameter cannot optional
|
|
|
|
const errIllegalOptionalURIParam = cerr("uri parameter cannot be optional")
|
2020-03-16 09:56:26 +00:00
|
|
|
|
2020-04-04 13:39:00 +00:00
|
|
|
// errOptionalOption - cannot have optional output
|
2020-04-04 12:34:20 +00:00
|
|
|
const errOptionalOption = cerr("output cannot be optional")
|
2020-03-29 14:59:32 +00:00
|
|
|
|
2020-04-04 13:39:00 +00:00
|
|
|
// errMissingParamDesc - missing parameter description
|
2020-04-04 12:34:20 +00:00
|
|
|
const errMissingParamDesc = cerr("missing parameter description")
|
2020-03-14 14:24:17 +00:00
|
|
|
|
2020-04-04 13:39:00 +00:00
|
|
|
// errUnknownDataType - unknown parameter datatype
|
|
|
|
const errUnknownDataType = cerr("unknown parameter datatype")
|
2020-03-14 23:27:54 +00:00
|
|
|
|
2020-04-04 13:39:00 +00:00
|
|
|
// errIllegalParamName - illegal parameter name
|
2020-04-04 12:34:20 +00:00
|
|
|
const errIllegalParamName = cerr("illegal parameter name")
|
2020-03-14 14:24:17 +00:00
|
|
|
|
2020-04-04 13:39:00 +00:00
|
|
|
// errMissingParamType - missing parameter type
|
2020-04-04 12:34:20 +00:00
|
|
|
const errMissingParamType = cerr("missing parameter type")
|
2020-03-14 14:24:17 +00:00
|
|
|
|
2020-04-04 13:39:00 +00:00
|
|
|
// errParamNameConflict - name/rename conflict
|
|
|
|
const errParamNameConflict = cerr("parameter name conflict")
|