model

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: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrorReasonUnknownError    ErrorType     = "UnknownError"
	ErrorCategoryReasonUnknown ErrorCategory = "Fatal.Sandbox"
	ErrorCategoryClientCaused  ErrorCategory = "Invalid.Client"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AppError

type AppError interface {
	error

	Severity() ErrorSeverity

	Source() ErrorSource

	ErrorCategory() ErrorCategory

	ErrorType() ErrorType

	Unwrap() error

	ReturnCode() int

	ErrorDetails() string
}

type ClientError

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

func NewClientError

func NewClientError(cause error, severity ErrorSeverity, errorType ErrorType) ClientError

func (ClientError) Error

func (e ClientError) Error() string

func (ClientError) ErrorCategory

func (e ClientError) ErrorCategory() ErrorCategory

func (ClientError) ErrorDetails

func (e ClientError) ErrorDetails() string

func (ClientError) ErrorType

func (e ClientError) ErrorType() ErrorType

func (ClientError) ReturnCode

func (e ClientError) ReturnCode() int

func (ClientError) Severity

func (e ClientError) Severity() ErrorSeverity

func (ClientError) Source

func (e ClientError) Source() ErrorSource

func (ClientError) Unwrap

func (e ClientError) Unwrap() error

type Credentials

type Credentials struct {
	AwsKey     string
	AwsSecret  string
	AwsSession string
}

type CustomerError

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

func NewCustomerError

func NewCustomerError(errorType ErrorType, opts ...ErrorOption) CustomerError

func WrapErrorIntoCustomerFatalError

func WrapErrorIntoCustomerFatalError(e error, errorType ErrorType) CustomerError

func WrapErrorIntoCustomerInvalidError

func WrapErrorIntoCustomerInvalidError(e error, errorType ErrorType) CustomerError

func (CustomerError) Error

func (e CustomerError) Error() string

func (CustomerError) ErrorCategory

func (e CustomerError) ErrorCategory() ErrorCategory

func (CustomerError) ErrorDetails

func (e CustomerError) ErrorDetails() string

func (CustomerError) ErrorType

func (e CustomerError) ErrorType() ErrorType

func (CustomerError) ReturnCode

func (e CustomerError) ReturnCode() int

func (CustomerError) Severity

func (e CustomerError) Severity() ErrorSeverity

func (CustomerError) Source

func (e CustomerError) Source() ErrorSource

func (CustomerError) Unwrap

func (e CustomerError) Unwrap() error

type ErrorCategory

type ErrorCategory string

func (ErrorCategory) String

func (e ErrorCategory) String() string

type ErrorOption

type ErrorOption func(err *appError)

func WithCause

func WithCause(cause error) ErrorOption

func WithErrorMessage

func WithErrorMessage(msg string) ErrorOption

func WithSeverity

func WithSeverity(sev ErrorSeverity) ErrorOption

type ErrorSeverity

type ErrorSeverity string
const (
	ErrorSeverityError   ErrorSeverity = "Error"
	ErrorSeverityFatal   ErrorSeverity = "Fatal"
	ErrorSeverityInvalid ErrorSeverity = "Invalid"
)

type ErrorSource

type ErrorSource string
const (
	ErrorSourceClient  ErrorSource = "Client"
	ErrorSourceSandbox ErrorSource = "Sandbox"
	ErrorSourceRuntime ErrorSource = "Runtime"
)

type ErrorType

type ErrorType string
const (
	ErrorInvalidRequest                    ErrorType = "InvalidRequest"
	ErrorMalformedRequest                  ErrorType = "ErrMalformedRequest"
	ErrorInitIncomplete                    ErrorType = "Client.InitIncomplete"
	ErrorEnvironmentUnhealthy              ErrorType = "Client.ExecutionEnvironmentUnhealthy"
	ErrorRuntimeUnavailable                ErrorType = "Runtime.Unavailable"
	ErrorDublicatedInvokeId                ErrorType = "Client.DuplicatedInvokeId"
	ErrorInvalidFunctionVersion            ErrorType = "ErrInvalidFunctionVersion"
	ErrorInvalidMaxPayloadSize             ErrorType = "ErrInvalidMaxPayloadSize"
	ErrorInvalidResponseBandwidthRate      ErrorType = "ErrInvalidResponseBandwidthRate"
	ErrorInvalidResponseBandwidthBurstSize ErrorType = "ErrInvalidResponseBandwidthBurstSize"
	ErrorExecutionEnvironmentShutdown      ErrorType = "Client.ExecutionEnvironmentShutDown"
)
const (
	ErrorAgentPermissionDenied  ErrorType = "PermissionDenied"
	ErrorAgentExtensionLaunch   ErrorType = "Extension.LaunchError"
	ErrorAgentTooManyExtensions ErrorType = "TooManyExtensions"
	ErrorAgentInit              ErrorType = "Extension.InitError"
	ErrorAgentExit              ErrorType = "Extension.ExitError"
	ErrorAgentCrash             ErrorType = "Extension.Crash"
	ErrorAgentUnknown           ErrorType = "Unknown"

	ErrorRuntimeInit                      ErrorType = "Runtime.InitError"
	ErrorRuntimeInvalidWorkingDir         ErrorType = "Runtime.InvalidWorkingDir"
	ErrorRuntimeInvalidEntryPoint         ErrorType = "Runtime.InvalidEntrypoint"
	ErrorRuntimeExit                      ErrorType = "Runtime.ExitError"
	ErrorRuntimeUnknown                   ErrorType = "Runtime.Unknown"
	ErrorRuntimeOutOfMemory               ErrorType = "Runtime.OutOfMemory"
	ErrorRuntimeTruncatedResponse         ErrorType = "Runtime.TruncatedResponse"
	ErrorRuntimeInvalidResponseModeHeader ErrorType = "Runtime.InvalidResponseModeHeader"

	ErrorRuntimeInvokeResponseInProgress ErrorType = "Runtime.InvokeResponseInProgress"
	ErrorRuntimeInvokeErrorInProgress    ErrorType = "Runtime.ErrorResponseInProgress"
	ErrorRuntimeInvokeResponseWasSent    ErrorType = "Runtime.InvokeResponseWasSent"
	ErrorRuntimeInvalidInvokeId          ErrorType = "Runtime.InvalidInvokeId"
	ErrorRuntimeInvokeTimeout            ErrorType = "Runtime.InvokeTimeout"
	ErrorRuntimeTooManyIdleRuntimes      ErrorType = "Runtime.TooManyIdleRuntimes"

	ErrorSandboxTimedout               ErrorType = "Sandbox.Timedout"
	ErrorSandboxFailure                ErrorType = "Sandbox.Failure"
	ErrorSandboxTimeoutResponseTrailer ErrorType = "Sandbox.TimeoutResponseTrailer"

	ErrorFunctionOversizedResponse ErrorType = "Function.ResponseSizeTooLarge"
	ErrorFunctionUnknown           ErrorType = "Function.Unknown"
)
const (
	ErrorReasonExtensionExecFailed    ErrorType = "ExtensionExecFailure"
	ErrorAgentCountRegistrationFailed ErrorType = "Extension.CountRegistrationFailed"
	ErrorAgentExtensionCreationFailed ErrorType = "Extension.CreationFailed"
	ErrorAgentRegistrationFailed      ErrorType = "Extension.RegistrationFailed"
	ErrorAgentReadyFailed             ErrorType = "Extension.ReadyFailed"
	ErrorAgentGateCreationFailed      ErrorType = "Extension.GateCreationFailed"

	ErrorReasonRuntimeExecFailed   ErrorType = "RuntimeExecFailure"
	ErrorRuntimeReadyFailed        ErrorType = "Runtime.ReadyFailed"
	ErrorRuntimeRegistrationFailed ErrorType = "Runtime.RegistrationFailed"

	ErrSandboxLogSocketsUnavailable ErrorType = "Sandbox.LogSocketsUnavailable"
	ErrSandboxEventSetupFailure     ErrorType = "Sandbox.EventSetupFailure"

	ErrSandboxShutdownFailed ErrorType = "Sandbox.ShutdownFailed"
)

func GetValidExtensionErrorType

func GetValidExtensionErrorType(errorType string, defaultErrorType ErrorType) ErrorType

func GetValidRuntimeOrFunctionErrorType

func GetValidRuntimeOrFunctionErrorType(errorType string) ErrorType

func (ErrorType) String

func (e ErrorType) String() string

type ExtensionsExec

type ExtensionsExec struct {
	Env        model.KVMap
	WorkingDir string
}

type ExternalAgents

type ExternalAgents struct {
	Bootstraps []string
	ExecConfig ExtensionsExec
}

type FunctionError

type FunctionError struct {
	Type ErrorType `json:"errorType,omitempty"`

	Message string `json:"errorMessage,omitempty"`
}

type FunctionMetadata

type FunctionMetadata struct {
	AccountID       string
	FunctionName    string
	FunctionVersion string
	MemorySizeBytes uint64
	Handler         string
	RuntimeInfo     RuntimeInfo
}

type PlatformError

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

func NewPlatformError

func NewPlatformError(cause error, errorType ErrorType) PlatformError

func WrapErrorIntoPlatformFatalError

func WrapErrorIntoPlatformFatalError(e error, errorType ErrorType) PlatformError

func (PlatformError) Error

func (e PlatformError) Error() string

func (PlatformError) ErrorCategory

func (e PlatformError) ErrorCategory() ErrorCategory

func (PlatformError) ErrorDetails

func (e PlatformError) ErrorDetails() string

func (PlatformError) ErrorType

func (e PlatformError) ErrorType() ErrorType

func (PlatformError) ReturnCode

func (e PlatformError) ReturnCode() int

func (PlatformError) Severity

func (e PlatformError) Severity() ErrorSeverity

func (PlatformError) Source

func (e PlatformError) Source() ErrorSource

func (PlatformError) Unwrap

func (e PlatformError) Unwrap() error

type Runtime

type Runtime struct {
	ExecConfig  RuntimeExec
	ConfigError *RuntimeExecError
}

type RuntimeExec

type RuntimeExec struct {
	Env        model.KVMap
	Cmd        []string
	WorkingDir string
}

type RuntimeExecError

type RuntimeExecError struct {
	Type RuntimeExecErrorType
	Err  error
}

type RuntimeExecErrorType

type RuntimeExecErrorType int
const (
	InvalidTaskConfig RuntimeExecErrorType = iota
	InvalidEntrypoint
	InvalidWorkingDir
)

func (RuntimeExecErrorType) FatalErrorType

func (e RuntimeExecErrorType) FatalErrorType() ErrorType

type RuntimeInfo

type RuntimeInfo struct {
	Arn     string
	Version string
}

type RuntimeNextWaiter

type RuntimeNextWaiter interface {
	RuntimeNextWait(ctx context.Context) AppError
}

Jump to

Keyboard shortcuts

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