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
|
|
|
|
|
|
|
// Error implements the error builtin interface.
|
2020-03-21 13:19:14 +00:00
|
|
|
func (err cerr) Error() string {
|
2020-03-14 14:24:17 +00:00
|
|
|
return string(err)
|
|
|
|
}
|
|
|
|
|
|
|
|
// ErrRead - a problem ocurred when trying to read the configuration file
|
2020-03-21 13:19:14 +00:00
|
|
|
const ErrRead = cerr("cannot read config")
|
2020-03-14 14:24:17 +00:00
|
|
|
|
|
|
|
// ErrUnknownMethod - invalid http method
|
2020-03-21 13:19:14 +00:00
|
|
|
const ErrUnknownMethod = cerr("unknown HTTP method")
|
2020-03-14 14:24:17 +00:00
|
|
|
|
|
|
|
// ErrFormat - a invalid format has been detected
|
2020-03-21 13:19:14 +00:00
|
|
|
const ErrFormat = cerr("invalid config format")
|
2020-03-14 14:24:17 +00:00
|
|
|
|
|
|
|
// ErrPatternCollision - there is a collision between 2 services' patterns (same method)
|
2020-03-21 14:15:33 +00:00
|
|
|
const ErrPatternCollision = cerr("pattern collision")
|
2020-03-14 14:24:17 +00:00
|
|
|
|
|
|
|
// ErrInvalidPattern - a service pattern is malformed
|
2020-03-21 13:19:14 +00:00
|
|
|
const ErrInvalidPattern = cerr("must begin with a '/' and not end with")
|
2020-03-14 14:24:17 +00:00
|
|
|
|
2020-03-15 00:37:28 +00:00
|
|
|
// ErrInvalidPatternBraceCapture - a service pattern brace capture is invalid
|
2020-03-21 13:19:14 +00:00
|
|
|
const ErrInvalidPatternBraceCapture = cerr("invalid uri capturing braces")
|
2020-03-14 14:24:17 +00:00
|
|
|
|
2020-03-15 00:37:28 +00:00
|
|
|
// ErrUnspecifiedBraceCapture - a parameter brace capture is not specified in the pattern
|
2020-03-21 13:19:14 +00:00
|
|
|
const ErrUnspecifiedBraceCapture = cerr("capturing brace missing in the path")
|
2020-03-14 14:24:17 +00:00
|
|
|
|
2020-03-16 09:56:26 +00:00
|
|
|
// ErrUndefinedBraceCapture - a parameter brace capture in the pattern is not defined in parameters
|
2020-03-21 13:19:14 +00:00
|
|
|
const ErrUndefinedBraceCapture = cerr("capturing brace missing input definition")
|
2020-03-16 09:56:26 +00:00
|
|
|
|
2020-03-14 14:24:17 +00:00
|
|
|
// ErrMissingDescription - a service is missing its description
|
2020-03-21 13:19:14 +00:00
|
|
|
const ErrMissingDescription = cerr("missing description")
|
2020-03-14 14:24:17 +00:00
|
|
|
|
2020-03-16 09:56:26 +00:00
|
|
|
// ErrIllegalOptionalURIParam - an URI parameter cannot be optional
|
2020-03-21 13:19:14 +00:00
|
|
|
const ErrIllegalOptionalURIParam = cerr("URI parameter cannot be optional")
|
2020-03-16 09:56:26 +00:00
|
|
|
|
2020-03-14 14:24:17 +00:00
|
|
|
// ErrMissingParamDesc - a parameter is missing its description
|
2020-03-21 13:19:14 +00:00
|
|
|
const ErrMissingParamDesc = cerr("missing parameter description")
|
2020-03-14 14:24:17 +00:00
|
|
|
|
2020-03-14 23:27:54 +00:00
|
|
|
// ErrUnknownDataType - a parameter has an unknown datatype name
|
2020-03-21 13:19:14 +00:00
|
|
|
const ErrUnknownDataType = cerr("unknown data type")
|
2020-03-14 23:27:54 +00:00
|
|
|
|
2020-03-14 14:24:17 +00:00
|
|
|
// ErrIllegalParamName - a parameter has an illegal name
|
2020-03-21 13:19:14 +00:00
|
|
|
const ErrIllegalParamName = cerr("illegal parameter name")
|
2020-03-14 14:24:17 +00:00
|
|
|
|
|
|
|
// ErrMissingParamType - a parameter has an illegal type
|
2020-03-21 13:19:14 +00:00
|
|
|
const ErrMissingParamType = cerr("missing parameter type")
|
2020-03-14 14:24:17 +00:00
|
|
|
|
|
|
|
// ErrParamNameConflict - a parameter has a conflict with its name/rename field
|
2020-03-21 13:19:14 +00:00
|
|
|
const ErrParamNameConflict = cerr("name conflict for parameter")
|