Documentation ¶
Overview ¶
Package testutil implements a fake ECS client to be used in tests.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DummyECS ¶
type DummyECS struct { Requests chan *http.Request RequestCount atomic.Uint64 // contains filtered or unexported fields }
DummyECS allows tests to mock ECS metadata server responses
func NewDummyECS ¶
NewDummyECS create a mock of the ECS metadata API.
type Option ¶
type Option func(*DummyECS)
Option represents an option used to create a new mock of the ECS metadata server.
func FileHandlerDelayOption ¶
FileHandlerDelayOption allows returning to requests matching a pattern with a delay.
func FileHandlerOption ¶
FileHandlerOption allows returning the content of a file to requests matching a pattern.
func RawHandlerDelayOption ¶
RawHandlerDelayOption allows returning to requests matching a pattern with a delay.
func RawHandlerOption ¶
RawHandlerOption allows returning the specified string to requests matching a pattern.
Click to show internal directories.
Click to hide internal directories.