executioncontext

package
v0.0.0-...-ad40689 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ColdStartTags

type ColdStartTags struct {
	IsColdStart     bool
	IsProactiveInit bool
}

type ExecutionContext

type ExecutionContext struct {
	// contains filtered or unexported fields
}

ExecutionContext represents the execution context

func (*ExecutionContext) GetColdStartTagsForRequestID

func (ec *ExecutionContext) GetColdStartTagsForRequestID(requestID string) ColdStartTags

Returns whether or not the given request ID is a cold start or is a proactive init

func (*ExecutionContext) GetCurrentState

func (ec *ExecutionContext) GetCurrentState() State

GetCurrentState gets the current state of the execution context

func (*ExecutionContext) IsStateSaved

func (ec *ExecutionContext) IsStateSaved() bool

IsStateSaved returns whether the state has been saved in the current execution

func (*ExecutionContext) LastRequestID

func (ec *ExecutionContext) LastRequestID() string

LastRequestID return the last seen request identifier through the extension API.

func (*ExecutionContext) RestoreCurrentStateFromFile

func (ec *ExecutionContext) RestoreCurrentStateFromFile() error

RestoreCurrentStateFromFile loads the current context from a file

func (*ExecutionContext) SaveCurrentExecutionContext

func (ec *ExecutionContext) SaveCurrentExecutionContext() error

SaveCurrentExecutionContext stores the current context to a file

func (*ExecutionContext) SetArnFromExtensionResponse

func (ec *ExecutionContext) SetArnFromExtensionResponse(arn string)

SetArnFromExtensionResponse sets the execution context from the Extension API response

func (*ExecutionContext) SetFromInvocation

func (ec *ExecutionContext) SetFromInvocation(arn string, requestID string)

SetFromInvocation sets the execution context based on an invocation

func (*ExecutionContext) SetInitializationTime

func (ec *ExecutionContext) SetInitializationTime(time time.Time)

SetInitTime sets the agent initialization time

func (*ExecutionContext) UpdateEndTime

func (ec *ExecutionContext) UpdateEndTime(time time.Time)

UpdateEndTime updates the execution context based on a platform.runtimeDone log message

func (*ExecutionContext) UpdateOutOfMemoryRequestID

func (ec *ExecutionContext) UpdateOutOfMemoryRequestID(requestId string)

UpdateOutOfMemoryRequestID updates the execution context with the request ID if an out of memory is detected either in the function or platform.report logs

func (*ExecutionContext) UpdatePersistedStateFilePath

func (ec *ExecutionContext) UpdatePersistedStateFilePath(path string)

UpdatePersistedStateFilePath sets the path of the persisted state file

func (*ExecutionContext) UpdateRuntime

func (ec *ExecutionContext) UpdateRuntime(runtime string)

UpdateRuntime updates the execution context with the runtime information

func (*ExecutionContext) UpdateStartTime

func (ec *ExecutionContext) UpdateStartTime(time time.Time)

UpdateStartTime updates the execution context based on a platform.Start log message

type State

type State struct {
	ARN                string
	LastRequestID      string
	ColdstartRequestID string
	WasColdStart       bool
	WasProactiveInit   bool
	LastLogRequestID   string
	LastOOMRequestID   string
	Runtime            string
	InitTime           time.Time
	StartTime          time.Time
	EndTime            time.Time
}

State represents the state of the execution context at a point in time

Jump to

Keyboard shortcuts

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