Documentation ¶
Index ¶
- Constants
- Variables
- func GetErrorMessage(err error) string
- func HasErrorCode(err error, code ValidationErrorCode) bool
- func IsValidationError(err error) bool
- type DuplicateValidator
- func (v DuplicateValidator) ValidateCreate(ctx context.Context, logger logr.Logger, namespace, newName string) error
- func (v DuplicateValidator) ValidateDelete(ctx context.Context, logger logr.Logger, namespace, oldName string) error
- func (v DuplicateValidator) ValidateUpdate(ctx context.Context, logger logr.Logger, namespace, oldName, newName string) error
- type NameRegistry
- type ValidationError
- type ValidationErrorCode
Constants ¶
View Source
const ( UnknownError = ValidationErrorCode(iota) DuplicateAppError DuplicateOrgNameError DuplicateSpaceNameError DuplicateRouteError DuplicateDomainError DuplicateServiceInstanceNameError RouteDestinationNotInSpace HostNameIsInvalidError PathValidationError )
Variables ¶
View Source
var ErrorDuplicateName = errors.New("name already used in namespace")
Functions ¶
func GetErrorMessage ¶
func HasErrorCode ¶
func HasErrorCode(err error, code ValidationErrorCode) bool
func IsValidationError ¶
Types ¶
type DuplicateValidator ¶
type DuplicateValidator struct {
// contains filtered or unexported fields
}
func NewDuplicateValidator ¶
func NewDuplicateValidator(nameRegistry NameRegistry) *DuplicateValidator
func (DuplicateValidator) ValidateCreate ¶
func (DuplicateValidator) ValidateDelete ¶
func (DuplicateValidator) ValidateUpdate ¶
type NameRegistry ¶
type ValidationError ¶
type ValidationError struct { Code ValidationErrorCode `json:"code"` Message string `json:"message"` }
func (ValidationError) Marshal ¶
func (v ValidationError) Marshal() string
type ValidationErrorCode ¶
type ValidationErrorCode int
func (ValidationErrorCode) GetMessage ¶
func (w ValidationErrorCode) GetMessage() string
func (ValidationErrorCode) Marshal ¶
func (w ValidationErrorCode) Marshal() string
func (*ValidationErrorCode) Unmarshall ¶
func (w *ValidationErrorCode) Unmarshall(payload string)
Directories ¶
Path | Synopsis |
---|---|
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
fake
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
fake
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
fake
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
Click to show internal directories.
Click to hide internal directories.