Documentation
¶
Index ¶
- Constants
- func HttpGetWithHeaders(client *http.Client, url string, headers *map[string]string) (*http.Response, error)
- func HttpPostWithHeaders(client *http.Client, url string, data []byte, headers *map[string]string) (*http.Response, error)
- func MakeMockFileUtil(extensions ExtensionsEnv) *utils.MockFileUtil
- func SetupMockFileUtil(extensions ExtensionsEnv, hasBootstrap bool, hasVarTask bool) *utils.MockFileUtil
- type ChunkedReader
- type Client
- func (client *Client) ExtensionsExitError(agentIdentifier, functionErrorType, payload string) (*StatusResponse, errorExtensions)
- func (client *Client) ExtensionsInitError(agentIdentifier, functionErrorType, payload string) (*StatusResponse, errorExtensions)
- func (client *Client) ExtensionsNext(agentIdentifier string) (interface{}, errorExtensions)
- func (client *Client) ExtensionsNextWithHeaders(headers map[string]string) (interface{}, errorExtensions)
- func (client *Client) ExtensionsRegister(agentUniqueName string, events []Event) (*http.Response, errorExtensions)
- func (client *Client) ExtensionsSleep(d time.Duration)
- func (client *Client) ExtensionsTelemetrySubscribe(agentIdentifier string, agentName string, body io.Reader, ...) (*http.Response, errorExtensions)
- func (client *Client) InitError(payload string, contentType string, errorType string) (*http.Response, error)
- func (client *Client) Next(body io.Reader) *http.Response
- func (client *Client) Response(invokeID interop.InvokeID, payload io.Reader, contentType string, ...) (*http.Response, error)
- func (client *Client) ResponseError(invokeID interop.InvokeID, payload string, contentType string, ...) (*http.Response, error)
- func (client *Client) ResponseErrorWithHeaders(invokeID interop.InvokeID, payload string, headers map[string]string) (*http.Response, error)
- type ConfigKey
- type Event
- type EventType
- type ExecutionEnvironmentAction
- type ExitAction
- type ExpectedExtensionEvents
- type ExpectedGlobalData
- type ExpectedInitEvent
- type ExpectedInvokeEvents
- type ExtensionTelemetrySubscribeAction
- type ExtensionsEnv
- type ExtensionsExecutionEnvironment
- type ExtensionsExitErrorAction
- type ExtensionsInitErrorAction
- type ExtensionsNextAction
- type ExtensionsNextParallelAction
- type ExtensionsRegisterAction
- type ExtensionsTelemetryAPIHTTPSubscriberAction
- type ExtensionsTelemetryAPITCPSubscriberAction
- type FluxPumpServer
- type InMemoryEventsApi
- func (e *InMemoryEventsApi) CheckComprehensiveInitExpectations(startTimestamp time.Time, finishTimestamp time.Time, ...)
- func (e *InMemoryEventsApi) CheckComprehensiveInvokeExpectations(startTimestamp time.Time, finishTimestamp time.Time, invokeID interop.InvokeID, ...)
- func (e *InMemoryEventsApi) CheckSimpleExtensionExpectations(expectedExtensionsEvents []ExpectedExtensionEvents)
- func (e *InMemoryEventsApi) CheckSimpleInitExpectations(startTimestamp time.Time, finishTimestamp time.Time, ...)
- func (e *InMemoryEventsApi) CheckSimpleInvokeExpectations(startTimestamp time.Time, finishTimestamp time.Time, invokeID interop.InvokeID, ...)
- func (e *InMemoryEventsApi) CheckXRayErrorCauseExpectations(invokeID interop.InvokeID, expectedErrorCause string)
- func (e *InMemoryEventsApi) Flush()
- func (e *InMemoryEventsApi) LogLines() []telemetry.Event
- func (e *InMemoryEventsApi) RecordLogLine(ev telemetry.Event)
- func (e *InMemoryEventsApi) SendExtensionInit(data interop.ExtensionInitData) error
- func (e *InMemoryEventsApi) SendImageError(errLog interop.ImageErrorLogData)
- func (e *InMemoryEventsApi) SendInitReport(data interop.InitReportData) error
- func (e *InMemoryEventsApi) SendInitRuntimeDone(data interop.InitRuntimeDoneData) error
- func (e *InMemoryEventsApi) SendInitStart(data interop.InitStartData) error
- func (e *InMemoryEventsApi) SendInternalXRayErrorCause(data interop.InternalXRayErrorCauseData) error
- func (e *InMemoryEventsApi) SendInvokeStart(data interop.InvokeStartData) error
- func (e *InMemoryEventsApi) SendReport(data interop.ReportData) error
- type InitErrorAction
- type InvocationResponseAction
- type InvocationResponseErrorAction
- type InvocationStreamingResponseAction
- type MockSupervisor
- func (m *MockSupervisor) Events(_ context.Context) (<-chan model.Event, error)
- func (m *MockSupervisor) Exec(_ context.Context, request *model.ExecRequest) error
- func (m *MockSupervisor) Kill(_ context.Context, request *model.KillRequest) error
- func (m *MockSupervisor) Terminate(_ context.Context, request *model.TerminateRequest) error
- type NextAction
- type NextResponse
- type RapidHTTPError
- type RegisterRequest
- type RuntimeEnv
- type RuntimeExecutionEnvironment
- type ShutdownResponse
- type SleepAction
- type SleepExtensionAction
- type StatusResponse
- type StderrAction
- type StdoutAction
- type SubscribeRequestLog
- type WaitInvokeResponseAction
Constants ¶
View Source
const ( ContentTypeHeader = "Content-Type" LambdaInvocationIDHeader = "Lambda-Runtime-Aws-Request-Id" LambdaInvocationDeadlineHeader = "Lambda-Runtime-Deadline-Ms" LambdaErrorTypeHeader = "Lambda-Runtime-Function-Error-Type" LambdaErrorBodyHeader = "Lambda-Runtime-Function-Error-Body" LambdaResponseModeHeader = "Lambda-Runtime-Function-Response-Mode" LambdaXRayErrorCauseHeader = "Lambda-Runtime-Function-XRay-Error-Cause" )
Variables ¶
This section is empty.
Functions ¶
func HttpGetWithHeaders ¶
func HttpPostWithHeaders ¶
func MakeMockFileUtil ¶
func MakeMockFileUtil(extensions ExtensionsEnv) *utils.MockFileUtil
func SetupMockFileUtil ¶
func SetupMockFileUtil(extensions ExtensionsEnv, hasBootstrap bool, hasVarTask bool) *utils.MockFileUtil
Types ¶
type ChunkedReader ¶
type ChunkedReader struct {
// contains filtered or unexported fields
}
func NewChunkedReader ¶
func NewChunkedReader(chunks []string, delay time.Duration) *ChunkedReader
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewExtensionsClient ¶
func (*Client) ExtensionsExitError ¶
func (client *Client) ExtensionsExitError(agentIdentifier, functionErrorType, payload string) (*StatusResponse, errorExtensions)
func (*Client) ExtensionsInitError ¶
func (client *Client) ExtensionsInitError(agentIdentifier, functionErrorType, payload string) (*StatusResponse, errorExtensions)
func (*Client) ExtensionsNext ¶
func (*Client) ExtensionsNextWithHeaders ¶
func (*Client) ExtensionsRegister ¶
func (*Client) ExtensionsSleep ¶
func (*Client) ExtensionsTelemetrySubscribe ¶
func (*Client) ResponseError ¶
type ExitAction ¶
type ExitAction struct {
ExitCode int32
CrashingProcessName string
// contains filtered or unexported fields
}
func (ExitAction) String ¶
func (a ExitAction) String() string
func (ExitAction) ValidateStatus ¶
func (a ExitAction) ValidateStatus(t *testing.T, resp *http.Response)
type ExpectedExtensionEvents ¶
type ExpectedGlobalData ¶
type ExpectedInitEvent ¶
type ExpectedInvokeEvents ¶
type ExtensionTelemetrySubscribeAction ¶
type ExtensionTelemetrySubscribeAction struct {
AgentIdentifier string
AgentName string
Payload io.Reader
Headers map[string][]string
RemoteAddr string
ExpectedStatus int
ExpectedErrorType string
ExpectedErrorMessage string
}
func (ExtensionTelemetrySubscribeAction) String ¶
func (a ExtensionTelemetrySubscribeAction) String() string
func (ExtensionTelemetrySubscribeAction) ValidateStatus ¶
func (a ExtensionTelemetrySubscribeAction) ValidateStatus(t *testing.T, resp *http.Response)
type ExtensionsEnv ¶
type ExtensionsEnv = map[string]*ExtensionsExecutionEnvironment
type ExtensionsExecutionEnvironment ¶
type ExtensionsExecutionEnvironment struct {
Actions []ExecutionEnvironmentAction
ForcedError error
ExtensionIdentifier uuid.UUID
T *testing.T
ExitProcessOnce func()
Stdout, Stderr io.Writer
Done sync.WaitGroup
}
func (*ExtensionsExecutionEnvironment) Exec ¶
func (e *ExtensionsExecutionEnvironment) Exec(request *model.ExecRequest) (<-chan struct{}, error)
func (*ExtensionsExecutionEnvironment) Kill ¶
func (e *ExtensionsExecutionEnvironment) Kill() error
func (*ExtensionsExecutionEnvironment) Terminate ¶
func (e *ExtensionsExecutionEnvironment) Terminate() error
type ExtensionsExitErrorAction ¶
type ExtensionsExitErrorAction struct {
AgentIdentifier string
FunctionErrorType string
Payload string
ExpectedStatus int
}
func (ExtensionsExitErrorAction) String ¶
func (a ExtensionsExitErrorAction) String() string
func (ExtensionsExitErrorAction) ValidateStatus ¶
func (a ExtensionsExitErrorAction) ValidateStatus(t *testing.T, resp *http.Response)
type ExtensionsInitErrorAction ¶
type ExtensionsInitErrorAction struct {
AgentIdentifier string
FunctionErrorType string
Payload string
ExpectedStatus int
}
func (ExtensionsInitErrorAction) String ¶
func (a ExtensionsInitErrorAction) String() string
func (ExtensionsInitErrorAction) ValidateStatus ¶
func (a ExtensionsInitErrorAction) ValidateStatus(t *testing.T, resp *http.Response)
type ExtensionsNextAction ¶
func (ExtensionsNextAction) String ¶
func (a ExtensionsNextAction) String() string
func (ExtensionsNextAction) ValidateStatus ¶
func (a ExtensionsNextAction) ValidateStatus(t *testing.T, resp *http.Response)
type ExtensionsNextParallelAction ¶
type ExtensionsNextParallelAction struct {
AgentIdentifier string
ExpectedStatus int
ParallelActions []ExecutionEnvironmentAction
Environment *ExtensionsExecutionEnvironment
}
func (ExtensionsNextParallelAction) String ¶
func (a ExtensionsNextParallelAction) String() string
func (ExtensionsNextParallelAction) ValidateStatus ¶
func (a ExtensionsNextParallelAction) ValidateStatus(t *testing.T, resp *http.Response)
type ExtensionsRegisterAction ¶
func (ExtensionsRegisterAction) String ¶
func (a ExtensionsRegisterAction) String() string
func (ExtensionsRegisterAction) ValidateStatus ¶
func (a ExtensionsRegisterAction) ValidateStatus(t *testing.T, resp *http.Response)
type ExtensionsTelemetryAPIHTTPSubscriberAction ¶
type ExtensionsTelemetryAPIHTTPSubscriberAction struct {
Subscription ExtensionTelemetrySubscribeAction
InMemoryEventsApi *InMemoryEventsApi
// contains filtered or unexported fields
}
func (ExtensionsTelemetryAPIHTTPSubscriberAction) String ¶
func (a ExtensionsTelemetryAPIHTTPSubscriberAction) String() string
func (ExtensionsTelemetryAPIHTTPSubscriberAction) ValidateStatus ¶
func (a ExtensionsTelemetryAPIHTTPSubscriberAction) ValidateStatus(t *testing.T, resp *http.Response)
type ExtensionsTelemetryAPITCPSubscriberAction ¶
type ExtensionsTelemetryAPITCPSubscriberAction struct {
Subscription ExtensionTelemetrySubscribeAction
InMemoryEventsApi *InMemoryEventsApi
// contains filtered or unexported fields
}
func (ExtensionsTelemetryAPITCPSubscriberAction) String ¶
func (a ExtensionsTelemetryAPITCPSubscriberAction) String() string
func (ExtensionsTelemetryAPITCPSubscriberAction) ValidateStatus ¶
func (a ExtensionsTelemetryAPITCPSubscriberAction) ValidateStatus(t *testing.T, resp *http.Response)
type FluxPumpServer ¶
type FluxPumpServer struct {
// contains filtered or unexported fields
}
func NewFluxPumpServer ¶
func NewFluxPumpServer() *FluxPumpServer
func (*FluxPumpServer) GetAddrPort ¶
func (s *FluxPumpServer) GetAddrPort() netip.AddrPort
func (*FluxPumpServer) GetRequests ¶
func (s *FluxPumpServer) GetRequests() []SubscribeRequestLog
func (*FluxPumpServer) ServeHTTP ¶
func (s *FluxPumpServer) ServeHTTP(w http.ResponseWriter, r *http.Request)
func (*FluxPumpServer) Stop ¶
func (s *FluxPumpServer) Stop() error
type InMemoryEventsApi ¶
type InMemoryEventsApi struct {
InvokeXRAYErrorCause map[interop.InvokeID]interop.InternalXRayErrorCauseData
// contains filtered or unexported fields
}
func NewInMemoryEventsApi ¶
func NewInMemoryEventsApi(t *testing.T) *InMemoryEventsApi
func (*InMemoryEventsApi) CheckComprehensiveInitExpectations ¶
func (e *InMemoryEventsApi) CheckComprehensiveInitExpectations(startTimestamp time.Time, finishTimestamp time.Time, expectedMinimalInitDuration time.Duration, expectedInitEvents []ExpectedInitEvent, initReq model.InitRequestMessage)
func (*InMemoryEventsApi) CheckComprehensiveInvokeExpectations ¶
func (e *InMemoryEventsApi) CheckComprehensiveInvokeExpectations(startTimestamp time.Time, finishTimestamp time.Time, invokeID interop.InvokeID, expectedInvokeEvents []ExpectedInvokeEvents, initReq model.InitRequestMessage, expectedInvokeLatency time.Duration, expectedInvokeRespDuration time.Duration)
func (*InMemoryEventsApi) CheckSimpleExtensionExpectations ¶
func (e *InMemoryEventsApi) CheckSimpleExtensionExpectations(expectedExtensionsEvents []ExpectedExtensionEvents)
func (*InMemoryEventsApi) CheckSimpleInitExpectations ¶
func (e *InMemoryEventsApi) CheckSimpleInitExpectations(startTimestamp time.Time, finishTimestamp time.Time, expectedInitEvents []ExpectedInitEvent, initReq model.InitRequestMessage)
func (*InMemoryEventsApi) CheckSimpleInvokeExpectations ¶
func (e *InMemoryEventsApi) CheckSimpleInvokeExpectations(startTimestamp time.Time, finishTimestamp time.Time, invokeID interop.InvokeID, expectedInvokeEvents []ExpectedInvokeEvents, initReq model.InitRequestMessage)
func (*InMemoryEventsApi) CheckXRayErrorCauseExpectations ¶
func (e *InMemoryEventsApi) CheckXRayErrorCauseExpectations(invokeID interop.InvokeID, expectedErrorCause string)
func (*InMemoryEventsApi) Flush ¶
func (e *InMemoryEventsApi) Flush()
func (*InMemoryEventsApi) LogLines ¶
func (e *InMemoryEventsApi) LogLines() []telemetry.Event
func (*InMemoryEventsApi) RecordLogLine ¶
func (e *InMemoryEventsApi) RecordLogLine(ev telemetry.Event)
func (*InMemoryEventsApi) SendExtensionInit ¶
func (e *InMemoryEventsApi) SendExtensionInit(data interop.ExtensionInitData) error
func (*InMemoryEventsApi) SendImageError ¶
func (e *InMemoryEventsApi) SendImageError(errLog interop.ImageErrorLogData)
func (*InMemoryEventsApi) SendInitReport ¶
func (e *InMemoryEventsApi) SendInitReport(data interop.InitReportData) error
func (*InMemoryEventsApi) SendInitRuntimeDone ¶
func (e *InMemoryEventsApi) SendInitRuntimeDone(data interop.InitRuntimeDoneData) error
func (*InMemoryEventsApi) SendInitStart ¶
func (e *InMemoryEventsApi) SendInitStart(data interop.InitStartData) error
func (*InMemoryEventsApi) SendInternalXRayErrorCause ¶
func (e *InMemoryEventsApi) SendInternalXRayErrorCause(data interop.InternalXRayErrorCauseData) error
func (*InMemoryEventsApi) SendInvokeStart ¶
func (e *InMemoryEventsApi) SendInvokeStart(data interop.InvokeStartData) error
func (*InMemoryEventsApi) SendReport ¶
func (e *InMemoryEventsApi) SendReport(data interop.ReportData) error
type InitErrorAction ¶
type InitErrorAction struct {
Payload string
ContentType string
ErrorType string
ExpectedStatus int
}
func (InitErrorAction) String ¶
func (a InitErrorAction) String() string
func (InitErrorAction) ValidateStatus ¶
func (a InitErrorAction) ValidateStatus(t *testing.T, resp *http.Response)
type InvocationResponseAction ¶
type InvocationResponseAction struct {
Payload io.Reader
ContentType string
InvokeID interop.InvokeID
ResponseModeHeader string
ExpectedStatus int
ExpectedBody string
Trailers map[string]string
}
func (InvocationResponseAction) String ¶
func (a InvocationResponseAction) String() string
func (InvocationResponseAction) ValidateStatus ¶
func (a InvocationResponseAction) ValidateStatus(t *testing.T, resp *http.Response)
type InvocationResponseErrorAction ¶
type InvocationResponseErrorAction struct {
Payload string
ContentType string
InvokeID interop.InvokeID
ErrorType string
ErrorCause string
ExpectedStatus int
ExpectedBody string
}
func (InvocationResponseErrorAction) String ¶
func (a InvocationResponseErrorAction) String() string
func (InvocationResponseErrorAction) ValidateStatus ¶
func (a InvocationResponseErrorAction) ValidateStatus(t *testing.T, resp *http.Response)
type InvocationStreamingResponseAction ¶
type InvocationStreamingResponseAction struct {
Chunks []string
ContentType string
InvokeID interop.InvokeID
ResponseModeHeader string
ChunkDelay time.Duration
Trailers map[string]string
}
func (InvocationStreamingResponseAction) String ¶
func (a InvocationStreamingResponseAction) String() string
func (InvocationStreamingResponseAction) ValidateStatus ¶
func (a InvocationStreamingResponseAction) ValidateStatus(t *testing.T, resp *http.Response)
type MockSupervisor ¶
type MockSupervisor struct {
// contains filtered or unexported fields
}
func NewMockSupervisor ¶
func NewMockSupervisor(t *testing.T, runtime process, extensions ExtensionsEnv, eventsErr error) *MockSupervisor
func (*MockSupervisor) Exec ¶
func (m *MockSupervisor) Exec(_ context.Context, request *model.ExecRequest) error
func (*MockSupervisor) Kill ¶
func (m *MockSupervisor) Kill(_ context.Context, request *model.KillRequest) error
func (*MockSupervisor) Terminate ¶
func (m *MockSupervisor) Terminate(_ context.Context, request *model.TerminateRequest) error
type NextAction ¶
func (NextAction) String ¶
func (a NextAction) String() string
func (NextAction) ValidateStatus ¶
func (a NextAction) ValidateStatus(t *testing.T, resp *http.Response)
type NextResponse ¶
type NextResponse struct {
EventType Event `json:"eventType"`
}
type RapidHTTPError ¶
func (*RapidHTTPError) Error ¶
func (s *RapidHTTPError) Error() string
type RegisterRequest ¶
type RegisterRequest struct {
Events []Event
}
type RuntimeEnv ¶
type RuntimeEnv struct {
Workers []RuntimeExecutionEnvironment
ForcedError error
T *testing.T
ExitProcessOnce func()
Stdout, Stderr io.Writer
InvokeResponseWG *sync.WaitGroup
Done sync.WaitGroup
}
func (*RuntimeEnv) Exec ¶
func (r *RuntimeEnv) Exec(request *model.ExecRequest) (<-chan struct{}, error)
func (*RuntimeEnv) Kill ¶
func (r *RuntimeEnv) Kill() error
func (*RuntimeEnv) Terminate ¶
func (r *RuntimeEnv) Terminate() error
type RuntimeExecutionEnvironment ¶
type RuntimeExecutionEnvironment struct {
Actions []ExecutionEnvironmentAction
InvokeID interop.InvokeID
RuntimeEnv *RuntimeEnv
}
type ShutdownResponse ¶
type ShutdownResponse struct {
*NextResponse
ShutdownReason string `json:"shutdownReason"`
DeadlineMs int64 `json:"deadlineMs"`
}
type SleepAction ¶
func (SleepAction) String ¶
func (a SleepAction) String() string
func (SleepAction) ValidateStatus ¶
func (a SleepAction) ValidateStatus(t *testing.T, resp *http.Response)
type SleepExtensionAction ¶
func (SleepExtensionAction) String ¶
func (a SleepExtensionAction) String() string
func (SleepExtensionAction) ValidateStatus ¶
func (a SleepExtensionAction) ValidateStatus(t *testing.T, resp *http.Response)
type StatusResponse ¶
type StatusResponse struct {
Status string `json:"status"`
}
type StderrAction ¶
type StderrAction struct {
Payload string
// contains filtered or unexported fields
}
func (StderrAction) String ¶
func (a StderrAction) String() string
func (StderrAction) ValidateStatus ¶
func (a StderrAction) ValidateStatus(t *testing.T, resp *http.Response)
type StdoutAction ¶
type StdoutAction struct {
Payload string
// contains filtered or unexported fields
}
func (StdoutAction) String ¶
func (a StdoutAction) String() string
func (StdoutAction) ValidateStatus ¶
func (a StdoutAction) ValidateStatus(t *testing.T, resp *http.Response)
type SubscribeRequestLog ¶
type WaitInvokeResponseAction ¶
type WaitInvokeResponseAction struct {
// contains filtered or unexported fields
}
func (WaitInvokeResponseAction) String ¶
func (a WaitInvokeResponseAction) String() string
func (WaitInvokeResponseAction) ValidateStatus ¶
func (a WaitInvokeResponseAction) ValidateStatus(t *testing.T, resp *http.Response)
Click to show internal directories.
Click to hide internal directories.