2020-03-14 14:24:17 +00:00
|
|
|
package config
|
|
|
|
|
2021-06-21 19:50:57 +00:00
|
|
|
// Err allows you to create constant "const" error with type boxing.
|
|
|
|
type Err string
|
2020-03-14 14:24:17 +00:00
|
|
|
|
2021-06-21 19:50:57 +00:00
|
|
|
func (err Err) Error() string {
|
2020-03-14 14:24:17 +00:00
|
|
|
return string(err)
|
|
|
|
}
|
|
|
|
|
2021-06-21 19:50:57 +00:00
|
|
|
const (
|
|
|
|
// ErrRead - read error
|
|
|
|
ErrRead = Err("cannot read config")
|
2020-03-14 14:24:17 +00:00
|
|
|
|
2021-06-21 19:50:57 +00:00
|
|
|
// ErrUnknownMethod - unknown http method
|
|
|
|
ErrUnknownMethod = Err("unknown HTTP method")
|
2020-03-14 14:24:17 +00:00
|
|
|
|
2021-06-21 19:50:57 +00:00
|
|
|
// ErrFormat - invalid format
|
|
|
|
ErrFormat = Err("invalid config format")
|
2020-03-14 14:24:17 +00:00
|
|
|
|
2021-06-21 19:50:57 +00:00
|
|
|
// ErrPatternCollision - collision between 2 services' patterns
|
|
|
|
ErrPatternCollision = Err("pattern collision")
|
2020-03-14 14:24:17 +00:00
|
|
|
|
2021-06-21 19:50:57 +00:00
|
|
|
// ErrInvalidPattern - malformed service pattern
|
|
|
|
ErrInvalidPattern = Err("malformed service path: must begin with a '/' and not end with")
|
2020-03-14 14:24:17 +00:00
|
|
|
|
2021-06-21 19:50:57 +00:00
|
|
|
// ErrInvalidPatternBraceCapture - invalid brace capture
|
|
|
|
ErrInvalidPatternBraceCapture = Err("invalid uri parameter")
|
2020-03-14 14:24:17 +00:00
|
|
|
|
2021-06-21 19:50:57 +00:00
|
|
|
// ErrUnspecifiedBraceCapture - missing path brace capture
|
|
|
|
ErrUnspecifiedBraceCapture = Err("missing uri parameter")
|
2020-03-14 14:24:17 +00:00
|
|
|
|
2021-06-21 19:50:57 +00:00
|
|
|
// ErrUndefinedBraceCapture - missing capturing brace definition
|
|
|
|
ErrUndefinedBraceCapture = Err("missing uri parameter definition")
|
2020-03-29 12:18:05 +00:00
|
|
|
|
2021-06-21 19:50:57 +00:00
|
|
|
// ErrMandatoryRename - capture/query parameters must be renamed
|
|
|
|
ErrMandatoryRename = Err("uri and query parameters must be renamed")
|
2020-03-16 09:56:26 +00:00
|
|
|
|
2021-06-21 19:50:57 +00:00
|
|
|
// ErrMissingDescription - a service is missing its description
|
|
|
|
ErrMissingDescription = Err("missing description")
|
2020-03-14 14:24:17 +00:00
|
|
|
|
2021-06-21 19:50:57 +00:00
|
|
|
// ErrIllegalOptionalURIParam - uri parameter cannot optional
|
|
|
|
ErrIllegalOptionalURIParam = Err("uri parameter cannot be optional")
|
2020-03-16 09:56:26 +00:00
|
|
|
|
2021-06-21 19:50:57 +00:00
|
|
|
// ErrOptionalOption - cannot have optional output
|
|
|
|
ErrOptionalOption = Err("output cannot be optional")
|
2020-03-29 14:59:32 +00:00
|
|
|
|
2021-06-21 19:50:57 +00:00
|
|
|
// ErrMissingParamDesc - missing parameter description
|
|
|
|
ErrMissingParamDesc = Err("missing parameter description")
|
2020-03-14 14:24:17 +00:00
|
|
|
|
2021-06-21 19:50:57 +00:00
|
|
|
// ErrUnknownParamType - unknown parameter type
|
|
|
|
ErrUnknownParamType = Err("unknown parameter datatype")
|
2020-03-14 23:27:54 +00:00
|
|
|
|
2021-06-21 19:50:57 +00:00
|
|
|
// ErrIllegalParamName - illegal parameter name
|
|
|
|
ErrIllegalParamName = Err("illegal parameter name")
|
2020-03-14 14:24:17 +00:00
|
|
|
|
2021-06-21 19:50:57 +00:00
|
|
|
// ErrMissingParamType - missing parameter type
|
|
|
|
ErrMissingParamType = Err("missing parameter type")
|
2020-03-14 14:24:17 +00:00
|
|
|
|
2021-06-21 19:50:57 +00:00
|
|
|
// ErrParamNameConflict - name/rename conflict
|
|
|
|
ErrParamNameConflict = Err("parameter name conflict")
|
|
|
|
)
|