Documentation ¶
Index ¶
- Variables
- func TimesAlmostEqual(at, bt time.Time) bool
- func UnmarshalCloudEventData(bytes []byte) (map[string]interface{}, error)
- func WithCloudEventsServer(test func(serverURL url.URL) error) (*cloudevents.Event, error)
- func WithEnviron(env map[string]string, body func() error) error
- type FakeClients
- func (c *FakeClients) Context() context.Context
- func (c *FakeClients) Dynamic() dynamic.Interface
- func (c *FakeClients) Eventing() eventingv1client.EventingV1Interface
- func (c *FakeClients) Messaging() messagingv1client.MessagingV1Interface
- func (c *FakeClients) Namespace() string
- func (c *FakeClients) Serving() servingv1client.ServingV1Interface
- func (c *FakeClients) Typed() kubernetes.Interface
- type Sender
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrCantStartCloudEventsServer = errors.New("can't start cloutevents server")
ErrCantStartCloudEventsServer if test cloud event server can't start.
View Source
var ErrCantUnmarshalData = errors.New("can't unmarshal data")
ErrCantUnmarshalData if given bytes can't be unmarshalled as JSON.
Functions ¶
func TimesAlmostEqual ¶ added in v0.27.0
TimesAlmostEqual returns true if both times are almost equal.
func UnmarshalCloudEventData ¶
UnmarshalCloudEventData will take bytes and unmarshall it as JSON to map structure.
func WithCloudEventsServer ¶
WithCloudEventsServer is a testing utility that help by starting a CloudEvents HTTP server which can catch a sent event.
Types ¶
type FakeClients ¶
type FakeClients struct { testing.TB Objects []runtime.Object // contains filtered or unexported fields }
FakeClients creates K8s clients from a list of objects using fake packages.
func (*FakeClients) Context ¶
func (c *FakeClients) Context() context.Context
func (*FakeClients) Dynamic ¶
func (c *FakeClients) Dynamic() dynamic.Interface
func (*FakeClients) Eventing ¶
func (c *FakeClients) Eventing() eventingv1client.EventingV1Interface
func (*FakeClients) Messaging ¶
func (c *FakeClients) Messaging() messagingv1client.MessagingV1Interface
func (*FakeClients) Namespace ¶
func (c *FakeClients) Namespace() string
func (*FakeClients) Serving ¶
func (c *FakeClients) Serving() servingv1client.ServingV1Interface
func (*FakeClients) Typed ¶
func (c *FakeClients) Typed() kubernetes.Interface
type Sender ¶
type Sender struct {
Sent []cloudevents.Event
}
Sender is a mock sender that will record sent events for testing.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.