validators

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2018 License: Apache-2.0 Imports: 5 Imported by: 3

Documentation

Index

Constants

View Source
const SAD = "i'm not happy Bob, NOT HAPPY"

SAD is an error string.

Variables

This section is empty.

Functions

This section is empty.

Types

type FakeValidator

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

FakeValidator can be used in tests.

func MakeHappyMapValidator

func MakeHappyMapValidator(t *testing.T) *FakeValidator

MakeHappyMapValidator makes a FakeValidator that always passes.

func MakeSadMapValidator

func MakeSadMapValidator(t *testing.T) *FakeValidator

MakeSadMapValidator makes a FakeValidator that always fails.

func (*FakeValidator) Validator

func (v *FakeValidator) Validator(_ map[string]string) error

Validator replaces apimachinery validation in tests. Can be set to fail or succeed to test error handling. Can confirm if run or not run by surrounding code.

func (*FakeValidator) VerifyCall

func (v *FakeValidator) VerifyCall()

VerifyCall returns true if Validator was used.

func (*FakeValidator) VerifyNoCall

func (v *FakeValidator) VerifyNoCall()

VerifyNoCall returns true if Validator was not used.

type MapValidatorFunc

type MapValidatorFunc func(map[string]string) error

MapValidatorFunc returns an error if a map contains errors.

func MakeAnnotationValidator

func MakeAnnotationValidator() MapValidatorFunc

MakeAnnotationValidator returns a MapValidatorFunc using apimachinery.

func MakeLabelValidator

func MakeLabelValidator() MapValidatorFunc

MakeLabelValidator returns a MapValidatorFunc using apimachinery.

Jump to

Keyboard shortcuts

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