Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateValidator ¶
func GenerateValidator( validate func(json.Unmarshaler) error, ) (string, error)
GenerateValidator registers a specialty resource type that can be used to test config behavior of another resource type as part of resource unmarshaling.
Types ¶
type ConfigTest ¶
type ConfigTest struct { ResourceType string IsValid func(json.Unmarshaler) error SyntacticallyBad []ConfigTestData SemanticallyBad []ConfigTestData Good []ConfigTestData ListenerTest bool }
ConfigTest represents an entire suite of tests for config behavior of a particular resource type.
func (*ConfigTest) Run ¶
func (c *ConfigTest) Run(t *testing.T)
Run executes the suite of config behavior tests.
type ConfigTestData ¶
ConfigTestData contains the data for a specific test case for config behavior, plus the corresponding explanation string.
type TestHandler ¶
type TestHandler struct { }
TestHandler is a dummy net/http.Handler implementation that can be used for testing.
func (*TestHandler) ServeHTTP ¶
func (t *TestHandler) ServeHTTP(http.ResponseWriter, *http.Request)
ServeHTTP implements net/http.Handler.
func (*TestHandler) UnmarshalJSON ¶
func (t *TestHandler) UnmarshalJSON([]byte) error
UnmarshalJSON implements encoding/json.Unmarshaler.
type TestListener ¶
type TestListener struct { }
TestListener is a dummy net.Listener that can be used for testing.
func (*TestListener) Accept ¶
func (t *TestListener) Accept() (net.Conn, error)
Accept implements net.Listener.
func (*TestListener) UnmarshalJSON ¶
func (t *TestListener) UnmarshalJSON([]byte) error
UnmarshalJSON implements encoding/json.Unmarshaler.