webhooks

package
v0.0.0-...-1c213c1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 25, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

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 GetErrorMessage(err error) string

func HasErrorCode

func HasErrorCode(err error, code ValidationErrorCode) bool

func IsValidationError

func IsValidationError(err error) bool

Types

type DuplicateValidator

type DuplicateValidator struct {
	// contains filtered or unexported fields
}

func NewDuplicateValidator

func NewDuplicateValidator(nameRegistry NameRegistry) *DuplicateValidator

func (DuplicateValidator) ValidateCreate

func (v DuplicateValidator) ValidateCreate(ctx context.Context, logger logr.Logger, namespace, newName string) error

func (DuplicateValidator) ValidateDelete

func (v DuplicateValidator) ValidateDelete(ctx context.Context, logger logr.Logger, namespace, oldName string) error

func (DuplicateValidator) ValidateUpdate

func (v DuplicateValidator) ValidateUpdate(ctx context.Context, logger logr.Logger, namespace, oldName, newName string) error

type NameRegistry

type NameRegistry interface {
	RegisterName(ctx context.Context, namespace, name string) error
	DeregisterName(ctx context.Context, namespace, name string) error
	TryLockName(ctx context.Context, namespace, name string) error
	UnlockName(ctx context.Context, namespace, name string) error
}

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL