interop

package
v0.0.0-...-4fa2157 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 2, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

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 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 GetConn

func GetConn(r *http.Request) net.Conn

func IsResponseStreamingMetrics

func IsResponseStreamingMetrics(metrics *InvokeResponseMetrics) bool

Types

type CancellableRequest

type CancellableRequest struct {
	Request *http.Request
}

func (*CancellableRequest) Cancel

func (c *CancellableRequest) Cancel() error

type ClientError

type ClientError struct {
	model.ClientError
}

type Done

type Done struct {
	WaitForExit bool
	ErrorType   model.ErrorType
	Meta        DoneMetadata
}

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 EndData

type EndData struct {
	InvokeID InvokeID `json:"requestId"`
}

func (*EndData) String

func (d *EndData) String() 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

type ErrorResponseTooLarge struct {
	MaxResponseSize int
	ResponseSize    int
}

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

func (d *FaultData) RenderFluxpumpMsg() string

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 InitFailure struct {
	Error         model.AppError
	ErrorType     model.ErrorType
	ErrorCategory model.ErrorCategory
	ErrorMessage  error

	NumActiveExtensions   int
	RuntimeRelease        string
	Ack                   chan struct{}
	NumInternalExtensions int
	NumExternalExtensions int
	RuntimeInitDuration   time.Duration
}

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 InitPhase

type InitPhase string

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 InitSuccess struct {
	NumActiveExtensions   int
	ExtensionNames        string
	RuntimeRelease        string
	Ack                   chan struct{}
	NumInternalExtensions int
	NumExternalExtensions int
	RuntimeInitDuration   time.Duration
}

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
}

func (Invoke) GetDeadlineMs

func (i Invoke) GetDeadlineMs(ctx context.Context) int64

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 InvokeID

type InvokeID = string

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 InvokeResponseHeaders struct {
	ContentType          string
	FunctionResponseMode string
}

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 InvokeSuccess struct {
	RuntimeRelease       string
	NumActiveExtensions  int
	ExtensionNames       string
	ExtensionsOverhead   time.Duration
	InvokeCompletionTime time.Duration
	InvokeReceivedTime   time.Time
	ResponseMetrics      ResponseMetrics
	InvokeResponseMode   InvokeResponseMode
}

type LifecyclePhase

type LifecyclePhase int
const (
	LifecyclePhaseInit LifecyclePhase = iota + 1
	LifecyclePhaseInvoke
)

type Message

type Message interface{}

type MockDurationMetricTimer

type MockDurationMetricTimer struct {
	mock.Mock
}

func NewMockDurationMetricTimer

func NewMockDurationMetricTimer(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockDurationMetricTimer

func (*MockDurationMetricTimer) Done

func (_m *MockDurationMetricTimer) Done()

type MockEventsAPI

type MockEventsAPI struct {
	mock.Mock
}

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

type MockHealthCheckResponse struct {
	mock.Mock
}

func NewMockHealthCheckResponse

func NewMockHealthCheckResponse(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockHealthCheckResponse

type MockInitMetrics

type MockInitMetrics struct {
	mock.Mock
}

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

type MockInitResponse struct {
	mock.Mock
}

func NewMockInitResponse

func NewMockInitResponse(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockInitResponse

type MockInitStaticDataProvider

type MockInitStaticDataProvider struct {
	mock.Mock
}

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

type MockInternalStateGetter struct {
	mock.Mock
}

func NewMockInternalStateGetter

func NewMockInternalStateGetter(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockInternalStateGetter

func (*MockInternalStateGetter) Execute

type MockInvokeMetrics

type MockInvokeMetrics struct {
	mock.Mock
}

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 (_m *MockInvokeMetrics) TriggerSentRequest(bytes int64, requestPayloadReadDuration time.Duration, requestPayloadWriteDuration time.Duration)

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

type MockInvokeRequest struct {
	mock.Mock
}

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

type MockInvokeResponse struct {
	mock.Mock
}

func NewMockInvokeResponse

func NewMockInvokeResponse(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockInvokeResponse

type MockInvokeResponseSender

type MockInvokeResponseSender struct {
	mock.Mock
}

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

type MockMessage struct {
	mock.Mock
}

func NewMockMessage

func NewMockMessage(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockMessage

type MockRapidContext

type MockRapidContext struct {
	mock.Mock
}

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

type MockServer struct {
	mock.Mock
}

func NewMockServer

func NewMockServer(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockServer

func (*MockServer) SendInitErrorResponse

func (_m *MockServer) SendInitErrorResponse(response *ErrorInvokeResponse) (*InvokeResponseMetrics, error)

type MockShutdownMetrics

type MockShutdownMetrics struct {
	mock.Mock
}

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

type MockShutdownResponse struct {
	mock.Mock
}

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 ResponseMetrics struct {
	RuntimeOutboundThroughputBps int64
	RuntimeProducedBytes         int64
	RuntimeResponseLatency       time.Duration
	RuntimeTimeThrottled         time.Duration
}

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 RuntimeDoneInvokeMetrics

type RuntimeDoneInvokeMetrics struct {
	ProducedBytes int64   `json:"producedBytes"`
	DurationMs    float64 `json:"durationMs"`
}

type RuntimeInitMetrics

type RuntimeInitMetrics struct {
	Duration time.Duration
	Error    error
}

type Server

type Server interface {
	SendInitErrorResponse(response *ErrorInvokeResponse) (*InvokeResponseMetrics, error)
}

type Shutdown

type Shutdown struct {
	DeadlineNs int64
}

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 Span struct {
	Name       string  `json:"name"`
	Start      string  `json:"start"`
	DurationMs float64 `json:"durationMs"`
}

func (*Span) String

func (s *Span) String() string

type StreamableInvokeResponse

type StreamableInvokeResponse struct {
	Headers  map[string]string
	Payload  io.Reader
	Trailers http.Header
	Request  *CancellableRequest
}

type TelemetrySubscriptionConfig

type TelemetrySubscriptionConfig struct {
	Passphrase string
	APIAddr    netip.AddrPort
}

type TelemetrySubscriptionMetrics

type TelemetrySubscriptionMetrics map[string]int

type TracingCtx

type TracingCtx struct {
	SpanID string            `json:"spanId,omitempty"`
	Type   model.TracingType `json:"type"`
	Value  string            `json:"value"`
}

type UnhealthyContainerResponse

type UnhealthyContainerResponse struct {
	ErrorType model.ErrorType
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL