Documentation ¶
Index ¶
- Variables
- type ErrorInfo
- func AlreadyExist(resource interface{}) *ErrorInfo
- func BadRequest(err error) *ErrorInfo
- func ClusterNotFoundError(clusterName string) *ErrorInfo
- func CreateMappingError(err string) *ErrorInfo
- func CreateResourceError(resourceType string) *ErrorInfo
- func CustomReturn(code int, format string, params ...interface{}) *ErrorInfo
- func DealError(err error) *ErrorInfo
- func DeployYamlError(err string) *ErrorInfo
- func GetResourceError(resourceType string) *ErrorInfo
- func New(errorInfo *ErrorInfo, params ...interface{}) *ErrorInfo
- func ParamsInvalid(err error) *ErrorInfo
- func ParamsMissing(param string) *ErrorInfo
- func UpdateResourceError(resourceType string) *ErrorInfo
- func UserNameDuplicated(name string) *ErrorInfo
Constants ¶
This section is empty.
Variables ¶
View Source
var ( MissingParamUserName = New(missingParam, "name") MissingParamPassword = New(missingParam, "password") InvalidParameterPassword = New(invalidParamValue, "password") InvalidParameterPhone = New(invalidParamValue, "phone") InvalidParameterEmail = New(invalidParamValue, "email") MissingParamFile = New(missingParam, "file") MissingParamNameOrPwdOrLoginType = New(missingParam, "name or password or login type") AuthenticateError = New(authenticateError) UserNotExist = New(userNotExist) InvalidToken = New(invalidToken) ForbiddenErr = New(forbidden) LdapConnectError = New(ldapConnectError) PasswordWrong = New(passwordWrong) UserIsDisabled = New(userIsDisabled) )
View Source
var ( InvalidBodyFormat = New(invalidBodyFormat) InvalidFileType = New(invalidFileType) InvalidResourceTypeErr = New(invalidResourceType) InvalidHttpMethod = New(invalidHttpMethod) )
View Source
var ( UserNotExistErr = New(&ErrorInfo{Code: http.StatusBadRequest, Message: "user not exist."}) KeyNotExistErr = New(&ErrorInfo{Code: http.StatusBadRequest, Message: "key not exist."}) NotMatchErr = New(&ErrorInfo{Code: http.StatusBadRequest, Message: "key and user not match."}) SecretNotMatchErr = New(&ErrorInfo{Code: http.StatusBadRequest, Message: "secretkey and accesskey not match."}) MaxKeyErr = New(&ErrorInfo{Code: http.StatusBadRequest, Message: "already have 5 credentials, can't create more."}) ServerErr = New(&ErrorInfo{Code: http.StatusInternalServerError, Message: "server error."}) NotFoundErr = New(&ErrorInfo{Code: http.StatusNotFound, Message: "not found"}) )
View Source
var ( MissNamespaceInObj = New(&ErrorInfo{http.StatusBadRequest, "miss namespace in .metadata.namespace."}) MissNameInObj = New(&ErrorInfo{http.StatusBadRequest, "miss namespace in .metadata.name."}) )
Functions ¶
This section is empty.
Types ¶
type ErrorInfo ¶
func AlreadyExist ¶ added in v1.8.3
func AlreadyExist(resource interface{}) *ErrorInfo
func BadRequest ¶
func ClusterNotFoundError ¶
func CreateMappingError ¶
func CreateResourceError ¶
func CustomReturn ¶
func DeployYamlError ¶
func GetResourceError ¶
func ParamsInvalid ¶ added in v1.8.3
func ParamsMissing ¶ added in v1.8.8
func UpdateResourceError ¶
func UserNameDuplicated ¶
Click to show internal directories.
Click to hide internal directories.