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