Documentation
¶
Index ¶
- Constants
- Variables
- func ConvertInvokeResponseModeToString(invokeResponseMode InvokeResponseMode) string
- func GetConn(r *http.Request) net.Conn
- func IsResponseStreamingMetrics(metrics *InvokeResponseMetrics) bool
- type CancellableRequest
- type ClientError
- type Done
- type DoneFail
- type DoneMetadata
- type DoneMetadataMetricsDimensions
- type DurationMetricTimer
- type EEStaticData
- type EndData
- type ErrInternalPlatformError
- type ErrTruncatedResponse
- type ErrorInvokeResponse
- type ErrorResponseTooLarge
- type ErrorResponseTooLargeDI
- type EventsAPI
- type ExtensionInitData
- type FaultData
- type FunctionResponseMode
- type HealthCheckResponse
- type HealthyContainerResponse
- type ImageErrorLogData
- type InitExecutionData
- func (i *InitExecutionData) AmiId() string
- func (i *InitExecutionData) ArtefactType() intmodel.ArtefactType
- func (i *InitExecutionData) AvailabilityZoneId() string
- func (i *InitExecutionData) FunctionARN() string
- func (i *InitExecutionData) FunctionTimeout() time.Duration
- func (i *InitExecutionData) FunctionVersion() string
- func (i *InitExecutionData) FunctionVersionID() string
- func (i *InitExecutionData) InitTimeout() time.Duration
- func (i *InitExecutionData) LogGroup() string
- func (i *InitExecutionData) LogStream() string
- func (i *InitExecutionData) MemorySizeMB() uint64
- func (i *InitExecutionData) RuntimeVersion() string
- func (i *InitExecutionData) TelemetryAPIAddr() netip.AddrPort
- func (i *InitExecutionData) TelemetryPassphrase() string
- func (i *InitExecutionData) XRayTracingMode() intmodel.XrayTracingMode
- type InitFailure
- type InitMetrics
- type InitPhase
- type InitReportData
- type InitReportMetrics
- type InitResponse
- type InitRuntimeDoneData
- type InitStartData
- type InitStaticDataProvider
- type InitSuccess
- type InternalStateGetter
- type InternalXRayErrorCauseData
- type Invoke
- type InvokeErrorTraceData
- type InvokeFailure
- type InvokeID
- type InvokeMetadataHeader
- type InvokeMetrics
- type InvokeRequest
- type InvokeResponse
- type InvokeResponseHeaders
- type InvokeResponseMetrics
- type InvokeResponseMode
- type InvokeResponseSender
- type InvokeRuntimeDoneData
- type InvokeStartData
- type InvokeSuccess
- type LifecyclePhase
- type Message
- type MockDurationMetricTimer
- type MockEventsAPI
- func (_m *MockEventsAPI) Flush()
- func (_m *MockEventsAPI) SendExtensionInit(_a0 ExtensionInitData) error
- func (_m *MockEventsAPI) SendImageError(_a0 ImageErrorLogData)
- func (_m *MockEventsAPI) SendInitReport(_a0 InitReportData) error
- func (_m *MockEventsAPI) SendInitRuntimeDone(_a0 InitRuntimeDoneData) error
- func (_m *MockEventsAPI) SendInitStart(_a0 InitStartData) error
- func (_m *MockEventsAPI) SendInternalXRayErrorCause(_a0 InternalXRayErrorCauseData) error
- func (_m *MockEventsAPI) SendInvokeStart(_a0 InvokeStartData) error
- func (_m *MockEventsAPI) SendReport(_a0 ReportData) error
- type MockHealthCheckResponse
- type MockInitMetrics
- func (_m *MockInitMetrics) RunDuration() time.Duration
- func (_m *MockInitMetrics) SendMetrics() error
- func (_m *MockInitMetrics) SetExtensionsNumber(internal int, external int)
- func (_m *MockInitMetrics) SetLogsAPIMetrics(_a0 TelemetrySubscriptionMetrics)
- func (_m *MockInitMetrics) TriggerGetRequest()
- func (_m *MockInitMetrics) TriggerInitCustomerPhaseDone()
- func (_m *MockInitMetrics) TriggerInitDone(_a0 model.AppError)
- func (_m *MockInitMetrics) TriggerRuntimeDone()
- func (_m *MockInitMetrics) TriggerStartRequest()
- func (_m *MockInitMetrics) TriggerStartingRuntime()
- type MockInitResponse
- type MockInitStaticDataProvider
- func (_m *MockInitStaticDataProvider) AmiId() string
- func (_m *MockInitStaticDataProvider) ArtefactType() model.ArtefactType
- func (_m *MockInitStaticDataProvider) AvailabilityZoneId() string
- func (_m *MockInitStaticDataProvider) FunctionARN() string
- func (_m *MockInitStaticDataProvider) FunctionTimeout() time.Duration
- func (_m *MockInitStaticDataProvider) FunctionVersion() string
- func (_m *MockInitStaticDataProvider) FunctionVersionID() string
- func (_m *MockInitStaticDataProvider) InitTimeout() time.Duration
- func (_m *MockInitStaticDataProvider) LogGroup() string
- func (_m *MockInitStaticDataProvider) LogStream() string
- func (_m *MockInitStaticDataProvider) MemorySizeMB() uint64
- func (_m *MockInitStaticDataProvider) RuntimeVersion() string
- func (_m *MockInitStaticDataProvider) XRayTracingMode() model.XrayTracingMode
- type MockInternalStateGetter
- type MockInvokeMetrics
- func (_m *MockInvokeMetrics) AttachDependencies(_a0 InitStaticDataProvider, _a1 EventsAPI)
- func (_m *MockInvokeMetrics) AttachInvokeRequest(_a0 InvokeRequest)
- func (_m *MockInvokeMetrics) SendInvokeFinishedEvent(tracingCtx *TracingCtx, xrayErrorCause json.RawMessage) error
- func (_m *MockInvokeMetrics) SendInvokeStartEvent(_a0 *TracingCtx) error
- func (_m *MockInvokeMetrics) SendMetrics(_a0 model.AppError) error
- func (_m *MockInvokeMetrics) TriggerGetRequest()
- func (_m *MockInvokeMetrics) TriggerGetResponse()
- func (_m *MockInvokeMetrics) TriggerInvokeDone() (time.Duration, *time.Duration, InitStaticDataProvider)
- func (_m *MockInvokeMetrics) TriggerSentRequest(bytes int64, requestPayloadReadDuration time.Duration, ...)
- func (_m *MockInvokeMetrics) TriggerSentResponse(runtimeResponseSent bool, responseErr model.AppError, ...)
- func (_m *MockInvokeMetrics) TriggerStartRequest()
- func (_m *MockInvokeMetrics) UpdateConcurrencyMetrics(inflightInvokes int, idleRuntimesCount int)
- type MockInvokeRequest
- func (_m *MockInvokeRequest) AddResponseHeader(_a0 string, _a1 string)
- func (_m *MockInvokeRequest) BodyReader() io.Reader
- func (_m *MockInvokeRequest) ClientContext() string
- func (_m *MockInvokeRequest) CognitoId() string
- func (_m *MockInvokeRequest) CognitoPoolId() string
- func (_m *MockInvokeRequest) ContentType() string
- func (_m *MockInvokeRequest) Deadline() time.Time
- func (_m *MockInvokeRequest) FunctionVersionID() string
- func (_m *MockInvokeRequest) InvokeID() string
- func (_m *MockInvokeRequest) MaxPayloadSize() int64
- func (_m *MockInvokeRequest) ResponseBandwidthBurstRate() int64
- func (_m *MockInvokeRequest) ResponseBandwidthRate() int64
- func (_m *MockInvokeRequest) ResponseMode() string
- func (_m *MockInvokeRequest) ResponseWriter() http.ResponseWriter
- func (_m *MockInvokeRequest) SetResponseHeader(_a0 string, _a1 string)
- func (_m *MockInvokeRequest) TraceId() string
- func (_m *MockInvokeRequest) UpdateFromInitData(_a0 InitStaticDataProvider) model.AppError
- func (_m *MockInvokeRequest) WriteResponseHeaders(_a0 int)
- type MockInvokeResponse
- type MockInvokeResponseSender
- type MockMessage
- type MockRapidContext
- func (_m *MockRapidContext) HandleInit(ctx context.Context, initData InitExecutionData, initMetrics InitMetrics) model.AppError
- func (_m *MockRapidContext) HandleInvoke(ctx context.Context, invokeRequest InvokeRequest, invokeMetrics InvokeMetrics) (model.AppError, bool)
- func (_m *MockRapidContext) HandleShutdown(shutdownCause model.AppError, metrics ShutdownMetrics) model.AppError
- func (_m *MockRapidContext) ProcessTerminationNotifier() <-chan model.AppError
- func (_m *MockRapidContext) RuntimeAPIAddrPort() netip.AddrPort
- type MockServer
- type MockShutdownMetrics
- type MockShutdownResponse
- type PlatformError
- type RapidContext
- type ReportData
- type ReportDurationMs
- type ReportMetrics
- type ResponseMetrics
- type ResponseMode
- type ResponseStatus
- type RuntimeDoneInvokeMetrics
- type RuntimeInitMetrics
- type Server
- type Shutdown
- type ShutdownMetrics
- type ShutdownResponse
- type ShutdownSuccess
- type Span
- type StreamableInvokeResponse
- type TelemetrySubscriptionConfig
- type TelemetrySubscriptionMetrics
- type TracingCtx
- type UnhealthyContainerResponse
Constants ¶
View Source
const ( MaxPayloadSize = 6*1024*1024 + 100 ResponseBandwidthRate = 2 * 1024 * 1024 ResponseBandwidthBurstSize = 6 * 1024 * 1024 MinResponseBandwidthRate = 32 * 1024 MaxResponseBandwidthRate = 64 * 1024 * 1024 MinResponseBandwidthBurstSize = 32 * 1024 MaxResponseBandwidthBurstSize = 64 * 1024 * 1024 InitializationType = "lambda-managed-instances" )
View Source
const ( ResponseModeBuffered = "Buffered" ResponseModeStreaming = "Streaming" )
View Source
const ( RequestIdProperty = "RequestId" MemorySizeMbProperty = "MemorySizeMB" FunctionArnProperty = "FunctionArn" FunctionVersionIdProperty = "FunctionVersionId" RuntimeVersionProperty = "RuntimeVersion" ArtefactTypeDimension = "ArtefactType" AvailabilityZoneDimension = "AvailabilityZoneId" WorkerAmiIdDimension = "WorkerAmiId" TotalDurationMetric = "TotalDuration" PlatformOverheadDurationMetric = "PlatformOverheadDuration" TotalExtensionsCountMetric = "TotalExtensionsCount" InternalExtensionsCountMetric = "InternalExtensionsCount" ExternalExtensionsCountMetric = "ExternalExtensionsCount" ShutdownAbortInvokesDurationMetric = "AbortInvokeDuration" ShutdownKillProcessDurationMetricTemplate = "Kill%sDuration" ShutdownRuntimeDuration = "StopRuntimeDuration" ShutdownExtensionsDuration = "StopExtensionsDuration" ShutdownWaitAllProcessesDuration = "WaitCustomerProcessesExitDuration" ShutdownRuntimeServerDuration = "StopRuntimeServerDuration" ClientErrorMetric = "ClientError" ClientErrorReasonTemplate = "ClientErrorReason-%s" CustomerErrorMetric = "CustomerError" CustomerErrorReasonTemplate = "CustomerErrorReason-%s" PlatformErrorMetric = "PlatformError" PlatformErrorReasonTemplate = "PlatformErrorReason-%s" NonCustomerErrorMetric = "NonCustomerError" )
View Source
const (
HTTPConnKey key = iota
)
Variables ¶
View Source
var ( ErrTimeout = errors.New("errTimeout") ErrPlatformError = errors.New("ErrPlatformError") )
View Source
var AllFunctionResponseModes = []string{ string(FunctionResponseModeBuffered), string(FunctionResponseModeStreaming), }
View Source
var AllInvokeResponseModes = []string{ string(InvokeResponseModeBuffered), string(InvokeResponseModeStreaming), }
View Source
var ErrInvalidFunctionResponseMode = fmt.Errorf("ErrInvalidFunctionResponseMode")
View Source
var ErrInvalidInvokeResponseMode = fmt.Errorf("ErrInvalidInvokeResponseMode")
View Source
var ErrInvalidMaxPayloadSize = fmt.Errorf("ErrInvalidMaxPayloadSize")
View Source
var ErrInvalidResponseBandwidthBurstSize = fmt.Errorf("ErrInvalidResponseBandwidthBurstSize")
View Source
var ErrInvalidResponseBandwidthRate = fmt.Errorf("ErrInvalidResponseBandwidthRate")
View Source
var ErrMalformedCustomerHeaders = fmt.Errorf("ErrMalformedCustomerHeaders")
View Source
var ErrReservationExpired = fmt.Errorf("ErrReservationExpired")
View Source
var ErrResponseSent = fmt.Errorf("ErrResponseSent")
Functions ¶
func ConvertInvokeResponseModeToString ¶
func ConvertInvokeResponseModeToString(invokeResponseMode InvokeResponseMode) string
func IsResponseStreamingMetrics ¶
func IsResponseStreamingMetrics(metrics *InvokeResponseMetrics) bool
Types ¶
type CancellableRequest ¶
func (*CancellableRequest) Cancel ¶
func (c *CancellableRequest) Cancel() error
type ClientError ¶
type ClientError struct {
model.ClientError
}
type DoneFail ¶
type DoneFail struct {
ErrorType model.ErrorType
Meta DoneMetadata
}
type DoneMetadata ¶
type DoneMetadata struct {
NumActiveExtensions int
ExtensionNames string
RuntimeRelease string
InvokeRequestReadTimeNs int64
InvokeRequestSizeBytes int64
InvokeCompletionTimeNs int64
InvokeReceivedTime int64
RuntimeReadyTime int64
RuntimeResponseLatencyMs float64
RuntimeTimeThrottledMs int64
RuntimeProducedBytes int64
RuntimeOutboundThroughputBps int64
MetricsDimensions DoneMetadataMetricsDimensions
}
type DoneMetadataMetricsDimensions ¶
type DoneMetadataMetricsDimensions struct {
InvokeResponseMode InvokeResponseMode
}
func (DoneMetadataMetricsDimensions) String ¶
func (dimensions DoneMetadataMetricsDimensions) String() string
type DurationMetricTimer ¶
type DurationMetricTimer interface {
Done()
}
type EEStaticData ¶
type EEStaticData struct {
FunctionARN string
FunctionVersionID string
InitTimeout time.Duration
FunctionTimeout time.Duration
LogGroupName string
LogStreamName string
XRayTracingMode intmodel.XrayTracingMode
ArtefactType intmodel.ArtefactType
RuntimeVersion string
AmiId string
AvailabilityZoneId string
}
type ErrInternalPlatformError ¶
type ErrInternalPlatformError struct{}
func (*ErrInternalPlatformError) Error ¶
func (s *ErrInternalPlatformError) Error() string
type ErrTruncatedResponse ¶
type ErrTruncatedResponse struct{}
func (*ErrTruncatedResponse) Error ¶
func (s *ErrTruncatedResponse) Error() string
type ErrorInvokeResponse ¶
type ErrorInvokeResponse struct {
Headers InvokeResponseHeaders
Payload []byte
FunctionError model.FunctionError
}
func GetErrorResponseWithFormattedErrorMessage ¶
func GetErrorResponseWithFormattedErrorMessage(errorType model.ErrorType, err error, invokeID InvokeID) *ErrorInvokeResponse
type ErrorResponseTooLarge ¶
func (*ErrorResponseTooLarge) AsErrorResponse ¶
func (s *ErrorResponseTooLarge) AsErrorResponse() *ErrorInvokeResponse
func (*ErrorResponseTooLarge) Error ¶
func (s *ErrorResponseTooLarge) Error() string
type ErrorResponseTooLargeDI ¶
type ErrorResponseTooLargeDI struct {
ErrorResponseTooLarge
}
type EventsAPI ¶
type EventsAPI interface {
SendInitStart(InitStartData) error
SendInitRuntimeDone(InitRuntimeDoneData) error
SendInitReport(InitReportData) error
SendExtensionInit(ExtensionInitData) error
SendImageError(ImageErrorLogData)
SendInternalXRayErrorCause(InternalXRayErrorCauseData) error
SendInvokeStart(InvokeStartData) error
SendReport(ReportData) error
Flush()
}
type ExtensionInitData ¶
type ExtensionInitData struct {
AgentName string `json:"name"`
State string `json:"state"`
Subscriptions []string `json:"events"`
ErrorType string `json:"errorType,omitempty"`
}
func (*ExtensionInitData) String ¶
func (d *ExtensionInitData) String() string
type FaultData ¶
type FaultData struct {
InvokeID InvokeID
Status ResponseStatus
ErrorType *rapidmodel.ErrorType
}
func (*FaultData) RenderFluxpumpMsg ¶
type FunctionResponseMode ¶
type FunctionResponseMode string
const ( FunctionResponseModeBuffered FunctionResponseMode = ResponseModeBuffered FunctionResponseModeStreaming FunctionResponseMode = ResponseModeStreaming )
func ConvertToFunctionResponseMode ¶
func ConvertToFunctionResponseMode(value string) (FunctionResponseMode, error)
type HealthCheckResponse ¶
type HealthCheckResponse interface {
// contains filtered or unexported methods
}
type HealthyContainerResponse ¶
type HealthyContainerResponse struct{}
type ImageErrorLogData ¶
type ImageErrorLogData struct {
ExecError rapidmodel.RuntimeExecError
ExecConfig rapidmodel.RuntimeExec
}
type InitExecutionData ¶
type InitExecutionData struct {
ExtensionEnv intmodel.KVMap
Runtime model.Runtime
Credentials model.Credentials
LogGroupName string
LogStreamName string
FunctionMetadata model.FunctionMetadata
RuntimeManagedLoggingFormats []supvmodel.ManagedLoggingFormat
StaticData EEStaticData
TelemetrySubscriptionConfig TelemetrySubscriptionConfig
}
func (*InitExecutionData) AmiId ¶
func (i *InitExecutionData) AmiId() string
func (*InitExecutionData) ArtefactType ¶
func (i *InitExecutionData) ArtefactType() intmodel.ArtefactType
func (*InitExecutionData) AvailabilityZoneId ¶
func (i *InitExecutionData) AvailabilityZoneId() string
func (*InitExecutionData) FunctionARN ¶
func (i *InitExecutionData) FunctionARN() string
func (*InitExecutionData) FunctionTimeout ¶
func (i *InitExecutionData) FunctionTimeout() time.Duration
func (*InitExecutionData) FunctionVersion ¶
func (i *InitExecutionData) FunctionVersion() string
func (*InitExecutionData) FunctionVersionID ¶
func (i *InitExecutionData) FunctionVersionID() string
func (*InitExecutionData) InitTimeout ¶
func (i *InitExecutionData) InitTimeout() time.Duration
func (*InitExecutionData) LogGroup ¶
func (i *InitExecutionData) LogGroup() string
func (*InitExecutionData) LogStream ¶
func (i *InitExecutionData) LogStream() string
func (*InitExecutionData) MemorySizeMB ¶
func (i *InitExecutionData) MemorySizeMB() uint64
func (*InitExecutionData) RuntimeVersion ¶
func (i *InitExecutionData) RuntimeVersion() string
func (*InitExecutionData) TelemetryAPIAddr ¶
func (i *InitExecutionData) TelemetryAPIAddr() netip.AddrPort
func (*InitExecutionData) TelemetryPassphrase ¶
func (i *InitExecutionData) TelemetryPassphrase() string
func (*InitExecutionData) XRayTracingMode ¶
func (i *InitExecutionData) XRayTracingMode() intmodel.XrayTracingMode
type InitFailure ¶
type InitMetrics ¶
type InitMetrics interface {
TriggerGetRequest()
SetLogsAPIMetrics(TelemetrySubscriptionMetrics)
SetExtensionsNumber(internal, external int)
TriggerStartRequest()
TriggerStartingRuntime()
TriggerRuntimeDone()
TriggerInitCustomerPhaseDone()
TriggerInitDone(model.AppError)
RunDuration() time.Duration
SendMetrics() error
}
type InitReportData ¶
type InitReportData struct {
InitializationType string `json:"initializationType"`
Metrics InitReportMetrics `json:"metrics"`
Phase InitPhase `json:"phase"`
Tracing *TracingCtx `json:"tracing,omitempty"`
Status ResponseStatus `json:"status"`
ErrorType *string `json:"errorType,omitempty"`
}
func (*InitReportData) String ¶
func (d *InitReportData) String() string
type InitReportMetrics ¶
type InitReportMetrics struct {
DurationMs float64 `json:"durationMs"`
}
type InitResponse ¶
type InitResponse interface {
// contains filtered or unexported methods
}
type InitRuntimeDoneData ¶
type InitRuntimeDoneData struct {
InitializationType string `json:"initializationType"`
Status ResponseStatus `json:"status"`
Phase InitPhase `json:"phase"`
ErrorType *string `json:"errorType,omitempty"`
Tracing *TracingCtx `json:"tracing,omitempty"`
}
func (*InitRuntimeDoneData) String ¶
func (d *InitRuntimeDoneData) String() string
type InitStartData ¶
type InitStartData struct {
InitializationType string `json:"initializationType"`
RuntimeVersion string `json:"runtimeVersion"`
RuntimeVersionArn string `json:"runtimeVersionArn"`
FunctionName string `json:"functionName"`
FunctionVersion string `json:"functionVersion"`
InstanceID string `json:"instanceId"`
InstanceMaxMemory uint64 `json:"instanceMaxMemory"`
Phase InitPhase `json:"phase"`
Tracing *TracingCtx `json:"tracing,omitempty"`
}
func (*InitStartData) String ¶
func (d *InitStartData) String() string
type InitStaticDataProvider ¶
type InitStaticDataProvider interface {
FunctionARN() string
FunctionVersion() string
FunctionVersionID() string
InitTimeout() time.Duration
FunctionTimeout() time.Duration
LogGroup() string
LogStream() string
XRayTracingMode() intmodel.XrayTracingMode
MemorySizeMB() uint64
ArtefactType() intmodel.ArtefactType
AmiId() string
RuntimeVersion() string
AvailabilityZoneId() string
}
type InitSuccess ¶
type InternalStateGetter ¶
type InternalStateGetter func() statejson.InternalStateDescription
type InternalXRayErrorCauseData ¶
type InternalXRayErrorCauseData struct {
InvokeID InvokeID `json:"requestId"`
Cause string `json:"cause"`
}
func (*InternalXRayErrorCauseData) String ¶
func (d *InternalXRayErrorCauseData) String() string
type Invoke ¶
type Invoke struct {
TraceID string
LambdaSegmentID string
ID string
InvokedFunctionArn string
CognitoIdentityID string
CognitoIdentityPoolID string
Deadline time.Time
FunctionTimeout time.Duration
ClientContext string
ContentType string
Payload io.Reader
VersionID string
InvokeReceivedTime time.Time
InvokeResponseMetrics *InvokeResponseMetrics
InvokeResponseMode InvokeResponseMode
}
type InvokeErrorTraceData ¶
type InvokeErrorTraceData struct {
InvokeID InvokeID `json:"requestId,omitempty"`
ErrorCause json.RawMessage `json:"ErrorCause,omitempty"`
}
type InvokeFailure ¶
type InvokeFailure struct {
ErrorType model.ErrorType
ErrorMessage error
RuntimeRelease string
NumActiveExtensions int
ExtensionsOverhead time.Duration
InvokeReceivedTime time.Time
ResponseMetrics ResponseMetrics
ExtensionNames string
DefaultErrorResponse *ErrorInvokeResponse
InvokeResponseMode InvokeResponseMode
}
type InvokeMetadataHeader ¶
type InvokeMetadataHeader string
type InvokeMetrics ¶
type InvokeMetrics interface {
TriggerGetRequest()
AttachInvokeRequest(InvokeRequest)
AttachDependencies(InitStaticDataProvider, EventsAPI)
UpdateConcurrencyMetrics(inflightInvokes, idleRuntimesCount int)
TriggerStartRequest()
TriggerSentRequest(bytes int64, requestPayloadReadDuration, requestPayloadWriteDuration time.Duration)
TriggerGetResponse()
TriggerSentResponse(runtimeResponseSent bool, responseErr model.AppError, streamingMetrics *InvokeResponseMetrics, errorPayloadSizeBytes int)
TriggerInvokeDone() (totalMs time.Duration, runMs *time.Duration, initData InitStaticDataProvider)
SendInvokeStartEvent(*TracingCtx) error
SendInvokeFinishedEvent(tracingCtx *TracingCtx, xrayErrorCause json.RawMessage) error
SendMetrics(model.AppError) error
}
type InvokeRequest ¶
type InvokeRequest interface {
ContentType() string
InvokeID() InvokeID
Deadline() time.Time
TraceId() string
ClientContext() string
CognitoId() string
CognitoPoolId() string
ResponseBandwidthRate() int64
ResponseBandwidthBurstRate() int64
MaxPayloadSize() int64
ResponseMode() string
BodyReader() io.Reader
ResponseWriter() http.ResponseWriter
SetResponseHeader(string, string)
AddResponseHeader(string, string)
WriteResponseHeaders(int)
UpdateFromInitData(InitStaticDataProvider) model.AppError
FunctionVersionID() string
}
type InvokeResponse ¶
type InvokeResponse interface {
// contains filtered or unexported methods
}
type InvokeResponseHeaders ¶
type InvokeResponseMetrics ¶
type InvokeResponseMetrics struct {
StartReadingResponseTime time.Time
FinishReadingResponseTime time.Time
TimeShaped time.Duration
ProducedBytes int64
OutboundThroughputBps int64
FunctionResponseMode FunctionResponseMode
RuntimeCalledResponse bool
TransferError error
Interrupted bool
ResponsePayloadReadDuration time.Duration
ResponsePayloadWriteDuration time.Duration
}
type InvokeResponseMode ¶
type InvokeResponseMode string
const ( InvokeResponseModeBuffered InvokeResponseMode = ResponseModeBuffered InvokeResponseModeStreaming InvokeResponseMode = ResponseModeStreaming )
type InvokeResponseSender ¶
type InvokeResponseSender interface {
SendResponse(invokeID InvokeID, response *StreamableInvokeResponse) (*InvokeResponseMetrics, error)
SendErrorResponse(invokeID InvokeID, response *ErrorInvokeResponse) (*InvokeResponseMetrics, error)
}
type InvokeRuntimeDoneData ¶
type InvokeRuntimeDoneData struct {
InvokeID InvokeID `json:"requestId"`
Status ResponseStatus `json:"status"`
Metrics *RuntimeDoneInvokeMetrics `json:"metrics,omitempty"`
Tracing *TracingCtx `json:"tracing,omitempty"`
Spans []Span `json:"spans,omitempty"`
ErrorType *string `json:"errorType,omitempty"`
InternalMetrics *InvokeResponseMetrics `json:"-"`
}
func (*InvokeRuntimeDoneData) String ¶
func (d *InvokeRuntimeDoneData) String() string
type InvokeStartData ¶
type InvokeStartData struct {
InvokeID InvokeID `json:"requestId"`
Version string `json:"version,omitempty"`
FunctionARN string `json:"functionArn,omitempty"`
Tracing *TracingCtx `json:"tracing,omitempty"`
}
func (*InvokeStartData) String ¶
func (d *InvokeStartData) String() string
type InvokeSuccess ¶
type LifecyclePhase ¶
type LifecyclePhase int
const ( LifecyclePhaseInit LifecyclePhase = iota + 1 LifecyclePhaseInvoke )
type MockDurationMetricTimer ¶
func NewMockDurationMetricTimer ¶
func NewMockDurationMetricTimer(t interface {
mock.TestingT
Cleanup(func())
}) *MockDurationMetricTimer
func (*MockDurationMetricTimer) Done ¶
func (_m *MockDurationMetricTimer) Done()
type MockEventsAPI ¶
func NewMockEventsAPI ¶
func NewMockEventsAPI(t interface {
mock.TestingT
Cleanup(func())
}) *MockEventsAPI
func (*MockEventsAPI) Flush ¶
func (_m *MockEventsAPI) Flush()
func (*MockEventsAPI) SendExtensionInit ¶
func (_m *MockEventsAPI) SendExtensionInit(_a0 ExtensionInitData) error
func (*MockEventsAPI) SendImageError ¶
func (_m *MockEventsAPI) SendImageError(_a0 ImageErrorLogData)
func (*MockEventsAPI) SendInitReport ¶
func (_m *MockEventsAPI) SendInitReport(_a0 InitReportData) error
func (*MockEventsAPI) SendInitRuntimeDone ¶
func (_m *MockEventsAPI) SendInitRuntimeDone(_a0 InitRuntimeDoneData) error
func (*MockEventsAPI) SendInitStart ¶
func (_m *MockEventsAPI) SendInitStart(_a0 InitStartData) error
func (*MockEventsAPI) SendInternalXRayErrorCause ¶
func (_m *MockEventsAPI) SendInternalXRayErrorCause(_a0 InternalXRayErrorCauseData) error
func (*MockEventsAPI) SendInvokeStart ¶
func (_m *MockEventsAPI) SendInvokeStart(_a0 InvokeStartData) error
func (*MockEventsAPI) SendReport ¶
func (_m *MockEventsAPI) SendReport(_a0 ReportData) error
type MockHealthCheckResponse ¶
func NewMockHealthCheckResponse ¶
func NewMockHealthCheckResponse(t interface {
mock.TestingT
Cleanup(func())
}) *MockHealthCheckResponse
type MockInitMetrics ¶
func NewMockInitMetrics ¶
func NewMockInitMetrics(t interface {
mock.TestingT
Cleanup(func())
}) *MockInitMetrics
func (*MockInitMetrics) RunDuration ¶
func (_m *MockInitMetrics) RunDuration() time.Duration
func (*MockInitMetrics) SendMetrics ¶
func (_m *MockInitMetrics) SendMetrics() error
func (*MockInitMetrics) SetExtensionsNumber ¶
func (_m *MockInitMetrics) SetExtensionsNumber(internal int, external int)
func (*MockInitMetrics) SetLogsAPIMetrics ¶
func (_m *MockInitMetrics) SetLogsAPIMetrics(_a0 TelemetrySubscriptionMetrics)
func (*MockInitMetrics) TriggerGetRequest ¶
func (_m *MockInitMetrics) TriggerGetRequest()
func (*MockInitMetrics) TriggerInitCustomerPhaseDone ¶
func (_m *MockInitMetrics) TriggerInitCustomerPhaseDone()
func (*MockInitMetrics) TriggerInitDone ¶
func (_m *MockInitMetrics) TriggerInitDone(_a0 model.AppError)
func (*MockInitMetrics) TriggerRuntimeDone ¶
func (_m *MockInitMetrics) TriggerRuntimeDone()
func (*MockInitMetrics) TriggerStartRequest ¶
func (_m *MockInitMetrics) TriggerStartRequest()
func (*MockInitMetrics) TriggerStartingRuntime ¶
func (_m *MockInitMetrics) TriggerStartingRuntime()
type MockInitResponse ¶
func NewMockInitResponse ¶
func NewMockInitResponse(t interface {
mock.TestingT
Cleanup(func())
}) *MockInitResponse
type MockInitStaticDataProvider ¶
func NewMockInitStaticDataProvider ¶
func NewMockInitStaticDataProvider(t interface {
mock.TestingT
Cleanup(func())
}) *MockInitStaticDataProvider
func (*MockInitStaticDataProvider) AmiId ¶
func (_m *MockInitStaticDataProvider) AmiId() string
func (*MockInitStaticDataProvider) ArtefactType ¶
func (_m *MockInitStaticDataProvider) ArtefactType() model.ArtefactType
func (*MockInitStaticDataProvider) AvailabilityZoneId ¶
func (_m *MockInitStaticDataProvider) AvailabilityZoneId() string
func (*MockInitStaticDataProvider) FunctionARN ¶
func (_m *MockInitStaticDataProvider) FunctionARN() string
func (*MockInitStaticDataProvider) FunctionTimeout ¶
func (_m *MockInitStaticDataProvider) FunctionTimeout() time.Duration
func (*MockInitStaticDataProvider) FunctionVersion ¶
func (_m *MockInitStaticDataProvider) FunctionVersion() string
func (*MockInitStaticDataProvider) FunctionVersionID ¶
func (_m *MockInitStaticDataProvider) FunctionVersionID() string
func (*MockInitStaticDataProvider) InitTimeout ¶
func (_m *MockInitStaticDataProvider) InitTimeout() time.Duration
func (*MockInitStaticDataProvider) LogGroup ¶
func (_m *MockInitStaticDataProvider) LogGroup() string
func (*MockInitStaticDataProvider) LogStream ¶
func (_m *MockInitStaticDataProvider) LogStream() string
func (*MockInitStaticDataProvider) MemorySizeMB ¶
func (_m *MockInitStaticDataProvider) MemorySizeMB() uint64
func (*MockInitStaticDataProvider) RuntimeVersion ¶
func (_m *MockInitStaticDataProvider) RuntimeVersion() string
func (*MockInitStaticDataProvider) XRayTracingMode ¶
func (_m *MockInitStaticDataProvider) XRayTracingMode() model.XrayTracingMode
type MockInternalStateGetter ¶
func NewMockInternalStateGetter ¶
func NewMockInternalStateGetter(t interface {
mock.TestingT
Cleanup(func())
}) *MockInternalStateGetter
func (*MockInternalStateGetter) Execute ¶
func (_m *MockInternalStateGetter) Execute() statejson.InternalStateDescription
type MockInvokeMetrics ¶
func NewMockInvokeMetrics ¶
func NewMockInvokeMetrics(t interface {
mock.TestingT
Cleanup(func())
}) *MockInvokeMetrics
func (*MockInvokeMetrics) AttachDependencies ¶
func (_m *MockInvokeMetrics) AttachDependencies(_a0 InitStaticDataProvider, _a1 EventsAPI)
func (*MockInvokeMetrics) AttachInvokeRequest ¶
func (_m *MockInvokeMetrics) AttachInvokeRequest(_a0 InvokeRequest)
func (*MockInvokeMetrics) SendInvokeFinishedEvent ¶
func (_m *MockInvokeMetrics) SendInvokeFinishedEvent(tracingCtx *TracingCtx, xrayErrorCause json.RawMessage) error
func (*MockInvokeMetrics) SendInvokeStartEvent ¶
func (_m *MockInvokeMetrics) SendInvokeStartEvent(_a0 *TracingCtx) error
func (*MockInvokeMetrics) SendMetrics ¶
func (_m *MockInvokeMetrics) SendMetrics(_a0 model.AppError) error
func (*MockInvokeMetrics) TriggerGetRequest ¶
func (_m *MockInvokeMetrics) TriggerGetRequest()
func (*MockInvokeMetrics) TriggerGetResponse ¶
func (_m *MockInvokeMetrics) TriggerGetResponse()
func (*MockInvokeMetrics) TriggerInvokeDone ¶
func (_m *MockInvokeMetrics) TriggerInvokeDone() (time.Duration, *time.Duration, InitStaticDataProvider)
func (*MockInvokeMetrics) TriggerSentRequest ¶
func (*MockInvokeMetrics) TriggerSentResponse ¶
func (_m *MockInvokeMetrics) TriggerSentResponse(runtimeResponseSent bool, responseErr model.AppError, streamingMetrics *InvokeResponseMetrics, errorPayloadSizeBytes int)
func (*MockInvokeMetrics) TriggerStartRequest ¶
func (_m *MockInvokeMetrics) TriggerStartRequest()
func (*MockInvokeMetrics) UpdateConcurrencyMetrics ¶
func (_m *MockInvokeMetrics) UpdateConcurrencyMetrics(inflightInvokes int, idleRuntimesCount int)
type MockInvokeRequest ¶
func NewMockInvokeRequest ¶
func NewMockInvokeRequest(t interface {
mock.TestingT
Cleanup(func())
}) *MockInvokeRequest
func (*MockInvokeRequest) AddResponseHeader ¶
func (_m *MockInvokeRequest) AddResponseHeader(_a0 string, _a1 string)
func (*MockInvokeRequest) BodyReader ¶
func (_m *MockInvokeRequest) BodyReader() io.Reader
func (*MockInvokeRequest) ClientContext ¶
func (_m *MockInvokeRequest) ClientContext() string
func (*MockInvokeRequest) CognitoId ¶
func (_m *MockInvokeRequest) CognitoId() string
func (*MockInvokeRequest) CognitoPoolId ¶
func (_m *MockInvokeRequest) CognitoPoolId() string
func (*MockInvokeRequest) ContentType ¶
func (_m *MockInvokeRequest) ContentType() string
func (*MockInvokeRequest) Deadline ¶
func (_m *MockInvokeRequest) Deadline() time.Time
func (*MockInvokeRequest) FunctionVersionID ¶
func (_m *MockInvokeRequest) FunctionVersionID() string
func (*MockInvokeRequest) InvokeID ¶
func (_m *MockInvokeRequest) InvokeID() string
func (*MockInvokeRequest) MaxPayloadSize ¶
func (_m *MockInvokeRequest) MaxPayloadSize() int64
func (*MockInvokeRequest) ResponseBandwidthBurstRate ¶
func (_m *MockInvokeRequest) ResponseBandwidthBurstRate() int64
func (*MockInvokeRequest) ResponseBandwidthRate ¶
func (_m *MockInvokeRequest) ResponseBandwidthRate() int64
func (*MockInvokeRequest) ResponseMode ¶
func (_m *MockInvokeRequest) ResponseMode() string
func (*MockInvokeRequest) ResponseWriter ¶
func (_m *MockInvokeRequest) ResponseWriter() http.ResponseWriter
func (*MockInvokeRequest) SetResponseHeader ¶
func (_m *MockInvokeRequest) SetResponseHeader(_a0 string, _a1 string)
func (*MockInvokeRequest) TraceId ¶
func (_m *MockInvokeRequest) TraceId() string
func (*MockInvokeRequest) UpdateFromInitData ¶
func (_m *MockInvokeRequest) UpdateFromInitData(_a0 InitStaticDataProvider) model.AppError
func (*MockInvokeRequest) WriteResponseHeaders ¶
func (_m *MockInvokeRequest) WriteResponseHeaders(_a0 int)
type MockInvokeResponse ¶
func NewMockInvokeResponse ¶
func NewMockInvokeResponse(t interface {
mock.TestingT
Cleanup(func())
}) *MockInvokeResponse
type MockInvokeResponseSender ¶
func NewMockInvokeResponseSender ¶
func NewMockInvokeResponseSender(t interface {
mock.TestingT
Cleanup(func())
}) *MockInvokeResponseSender
func (*MockInvokeResponseSender) SendErrorResponse ¶
func (_m *MockInvokeResponseSender) SendErrorResponse(invokeID string, response *ErrorInvokeResponse) (*InvokeResponseMetrics, error)
func (*MockInvokeResponseSender) SendResponse ¶
func (_m *MockInvokeResponseSender) SendResponse(invokeID string, response *StreamableInvokeResponse) (*InvokeResponseMetrics, error)
type MockMessage ¶
func NewMockMessage ¶
func NewMockMessage(t interface {
mock.TestingT
Cleanup(func())
}) *MockMessage
type MockRapidContext ¶
func NewMockRapidContext ¶
func NewMockRapidContext(t interface {
mock.TestingT
Cleanup(func())
}) *MockRapidContext
func (*MockRapidContext) HandleInit ¶
func (_m *MockRapidContext) HandleInit(ctx context.Context, initData InitExecutionData, initMetrics InitMetrics) model.AppError
func (*MockRapidContext) HandleInvoke ¶
func (_m *MockRapidContext) HandleInvoke(ctx context.Context, invokeRequest InvokeRequest, invokeMetrics InvokeMetrics) (model.AppError, bool)
func (*MockRapidContext) HandleShutdown ¶
func (_m *MockRapidContext) HandleShutdown(shutdownCause model.AppError, metrics ShutdownMetrics) model.AppError
func (*MockRapidContext) ProcessTerminationNotifier ¶
func (_m *MockRapidContext) ProcessTerminationNotifier() <-chan model.AppError
func (*MockRapidContext) RuntimeAPIAddrPort ¶
func (_m *MockRapidContext) RuntimeAPIAddrPort() netip.AddrPort
type MockServer ¶
func NewMockServer ¶
func NewMockServer(t interface {
mock.TestingT
Cleanup(func())
}) *MockServer
func (*MockServer) SendInitErrorResponse ¶
func (_m *MockServer) SendInitErrorResponse(response *ErrorInvokeResponse) (*InvokeResponseMetrics, error)
type MockShutdownMetrics ¶
func NewMockShutdownMetrics ¶
func NewMockShutdownMetrics(t interface {
mock.TestingT
Cleanup(func())
}) *MockShutdownMetrics
func (*MockShutdownMetrics) AddMetric ¶
func (_m *MockShutdownMetrics) AddMetric(metric servicelogs.Metric)
func (*MockShutdownMetrics) CreateDurationMetric ¶
func (_m *MockShutdownMetrics) CreateDurationMetric(name string) DurationMetricTimer
func (*MockShutdownMetrics) SendMetrics ¶
func (_m *MockShutdownMetrics) SendMetrics(error model.AppError)
func (*MockShutdownMetrics) SetAgentCount ¶
func (_m *MockShutdownMetrics) SetAgentCount(internal int, external int)
type MockShutdownResponse ¶
func NewMockShutdownResponse ¶
func NewMockShutdownResponse(t interface {
mock.TestingT
Cleanup(func())
}) *MockShutdownResponse
type PlatformError ¶
type PlatformError struct {
model.PlatformError
RuntimeRelease string
}
type RapidContext ¶
type RapidContext interface {
HandleInit(ctx context.Context, initData InitExecutionData, initMetrics InitMetrics) (err model.AppError)
HandleShutdown(shutdownCause model.AppError, metrics ShutdownMetrics) model.AppError
HandleInvoke(ctx context.Context, invokeRequest InvokeRequest, invokeMetrics InvokeMetrics) (err model.AppError, wasResponseSent bool)
RuntimeAPIAddrPort() netip.AddrPort
ProcessTerminationNotifier() <-chan model.AppError
}
type ReportData ¶
type ReportData struct {
InvokeID InvokeID `json:"requestId"`
Status ResponseStatus `json:"status"`
Metrics ReportMetrics `json:"metrics"`
Tracing *TracingCtx `json:"tracing,omitempty"`
Spans []Span `json:"spans,omitempty"`
ErrorType *rapidmodel.ErrorType `json:"errorType,omitempty"`
}
func (*ReportData) String ¶
func (d *ReportData) String() string
type ReportDurationMs ¶
type ReportDurationMs float64
func (ReportDurationMs) MarshalJSON ¶
func (d ReportDurationMs) MarshalJSON() ([]byte, error)
type ReportMetrics ¶
type ReportMetrics struct {
DurationMs ReportDurationMs `json:"durationMs"`
}
type ResponseMetrics ¶
type ResponseMode ¶
type ResponseMode string
type ResponseStatus ¶
type ResponseStatus = string
const ( Success ResponseStatus = "success" Timeout ResponseStatus = "timeout" Error ResponseStatus = "error" Failure ResponseStatus = "failure" )
func BuildStatusFromError ¶
func BuildStatusFromError(err model.AppError) ResponseStatus
type RuntimeInitMetrics ¶
type Server ¶
type Server interface {
SendInitErrorResponse(response *ErrorInvokeResponse) (*InvokeResponseMetrics, error)
}
type ShutdownMetrics ¶
type ShutdownMetrics interface {
CreateDurationMetric(name string) DurationMetricTimer
AddMetric(metric servicelogs.Metric)
SetAgentCount(internal, external int)
SendMetrics(error model.AppError)
}
type ShutdownResponse ¶
type ShutdownResponse interface {
// contains filtered or unexported methods
}
type ShutdownSuccess ¶
type ShutdownSuccess struct{}
type Span ¶
type TracingCtx ¶
type TracingCtx struct {
SpanID string `json:"spanId,omitempty"`
Type model.TracingType `json:"type"`
Value string `json:"value"`
}
Source Files
¶
- cancellable_request.go
- error_utils.go
- events_api.go
- mock_duration_metric_timer.go
- mock_events_api.go
- mock_health_check_response.go
- mock_init_metrics.go
- mock_init_response.go
- mock_init_static_data_provider.go
- mock_internal_state_getter.go
- mock_invoke_metrics.go
- mock_invoke_request.go
- mock_invoke_response.go
- mock_invoke_response_sender.go
- mock_message.go
- mock_rapid_context.go
- mock_server.go
- mock_shutdown_metrics.go
- mock_shutdown_response.go
- model.go
- response_status.go
- sandbox_model.go
- service_log_values.go
Click to show internal directories.
Click to hide internal directories.