{"modulePath":"github.com/aws/aws-lambda-runtime-interface-emulator","version":"v0.0.0-20261030222936-bef5c4ba774d","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package rapidcore\n\n## Constants\n\n```go\nconst (\n\tRuntimeLogSink logSink = iota\n\tExtensionLogSink\n)\n```\n\n```go\nconst RuntimeReleasePath = \"/var/runtime/runtime-release\"\n```\n\n## Variables\n\n```go\nvar ErrAlreadyInvocating = errors.New(\"AlreadyInvocating\")\n```\n\n```go\nvar ErrAlreadyReplied = errors.New(\"AlreadyReplied\")\n```\n\n```go\nvar ErrAlreadyReserved = errors.New(\"AlreadyReserved\")\n```\n\n```go\nvar ErrInitDoneFailed = errors.New(\"InitDoneFailed\")\n```\n\n```go\nvar ErrInitNotStarted = errors.New(\"InitNotStarted\")\n```\n\n```go\nvar ErrInitResetReceived = errors.New(\"InitResetReceived\")\n```\n\n```go\nvar ErrInternalServerError = errors.New(\"InternalServerError\")\n```\n\n```go\nvar ErrInvokeDoneFailed = errors.New(\"InvokeDoneFailed\")\n```\n\n```go\nvar ErrInvokeReservationDone = errors.New(\"InvokeReservationDone\")\n```\n\n```go\nvar ErrInvokeResponseAlreadyWritten = errors.New(\"InvokeResponseAlreadyWritten\")\n```\n\n```go\nvar ErrInvokeTimeout = errors.New(\"InvokeTimeout\")\n```\n\n```go\nvar ErrNotReserved = errors.New(\"NotReserved\")\n```\n\n```go\nvar ErrReleaseReservationDone = errors.New(\"ReleaseReservationDone\")\n```\n\n```go\nvar ErrReserveReservationDone = errors.New(\"ReserveReservationDone\")\n```\n\n## Functions\n\n```go\nfunc ParsePropertiesFile(path string) (map[string]string, error)\n```\nParsePropertiesFile reads key-value pairs from file in newline-separated list of environment-like shell-compatible variable assignments. Format: [https://www.freedesktop.org/software/systemd/man/os-release.html](https://www.freedesktop.org/software/systemd/man/os-release.html) Value quotes are trimmed. Latest write wins for duplicated keys.\n\n```go\nfunc SetInternalLogOutput(w io.Writer)\n```\n\n```go\nfunc SetLogLevel(logLevel string)\n```\nSetLogLevel sets the log level for internal logging. Needs to be called very early during startup to configure logs emitted during initialization\n\n## Types\n\n```go\ntype DoneWithState struct {\n\t*interop.Done\n\tState statejson.InternalStateDescription\n}\n```\n\n```go\nfunc (s *DoneWithState) String() string\n```\n\n```go\ntype EmulatorAPI struct {\n\t// contains filtered or unexported fields\n}\n```\nEmulatorAPI wraps the standalone interop server to provide a convenient interface for Rapid Standalone\n\n```go\nfunc NewEmulatorAPI(s *Server) *EmulatorAPI\n```\n\n```go\nfunc (l *EmulatorAPI) Init(i *interop.Init, timeoutMs int64)\n```\nInit method is only used by the Runtime interface emulator\n\n```go\nfunc (l *EmulatorAPI) Invoke(w http.ResponseWriter, i *interop.Invoke) error\n```\nInvoke method is only used by the Runtime interface emulator\n\n```go\ntype InvokeContext struct {\n\tToken       interop.Token\n\tReplySent   bool\n\tReplyStream http.ResponseWriter\n\tDirect      bool\n}\n```\n\n```go\ntype LambdaInvokeAPI interface {\n\tInit(i *interop.Init, invokeTimeoutMs int64)\n\tInvoke(responseWriter http.ResponseWriter, invoke *interop.Invoke) error\n}\n```\nLambdaInvokeAPI are the methods used by the Runtime Interface Emulator\n\n```go\ntype Logging string\n```\n\n```go\nconst (\n\tAmznStdout    Logging = \"amzn-stdout\"\n\tAmznStdoutTLV Logging = \"amzn-stdout-tlv\"\n)\n```\n\n```go\ntype ReserveResponse struct {\n\tToken         interop.Token\n\tInternalState *statejson.InternalStateDescription\n}\n```\n\n```go\ntype RuntimeRelease struct {\n\tName    string\n\tVersion string\n\tLogging Logging\n}\n```\nRuntimeRelease stores runtime identification data\n\n```go\nfunc GetRuntimeRelease(path string) (*RuntimeRelease, error)\n```\nGetRuntimeRelease reads Runtime identification data from config file and parses it into a struct\n\n```go\ntype SandboxBuilder struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewSandboxBuilder() *SandboxBuilder\n```\n\n```go\nfunc (b *SandboxBuilder) AddShutdownFunc(shutdownFunc func()) *SandboxBuilder\n```\n\n```go\nfunc (b *SandboxBuilder) Create() (interop.SandboxContext, interop.InternalStateGetter)\n```\n\n```go\nfunc (b *SandboxBuilder) DefaultInteropServer() *Server\n```\n\n```go\nfunc (b *SandboxBuilder) DisableStandaloneMode() *SandboxBuilder\n```\n\n```go\nfunc (b *SandboxBuilder) LambdaInvokeAPI() LambdaInvokeAPI\n```\n\n```go\nfunc (b *SandboxBuilder) SetEventsAPI(eventsAPI interop.EventsAPI) *SandboxBuilder\n```\n\n```go\nfunc (b *SandboxBuilder) SetExtensionsFlag(extensionsEnabled bool) *SandboxBuilder\n```\n\n```go\nfunc (b *SandboxBuilder) SetHandler(handler string) *SandboxBuilder\n```\n\n```go\nfunc (b *SandboxBuilder) SetInitCachingFlag(initCachingEnabled bool) *SandboxBuilder\n```\n\n```go\nfunc (b *SandboxBuilder) SetInteropServer(interopServer interop.Server) *SandboxBuilder\n```\n\n```go\nfunc (b *SandboxBuilder) SetLogsEgressAPI(logsEgressAPI telemetry.StdLogsEgressAPI) *SandboxBuilder\n```\n\n```go\nfunc (b *SandboxBuilder) SetRuntimeAPIAddress(runtimeAPIAddress string) *SandboxBuilder\n```\n\n```go\nfunc (b *SandboxBuilder) SetRuntimeFsRootPath(rootPath string) *SandboxBuilder\n```\n\n```go\nfunc (b *SandboxBuilder) SetSupervisor(supervisor supvmodel.ProcessSupervisor) *SandboxBuilder\n```\n\n```go\nfunc (b *SandboxBuilder) SetTelemetrySubscription(logsSubscriptionAPI telemetry.SubscriptionAPI, telemetrySubscriptionAPI telemetry.SubscriptionAPI) *SandboxBuilder\n```\n\n```go\nfunc (b *SandboxBuilder) SetTracer(tracer telemetry.Tracer) *SandboxBuilder\n```\n\n```go\ntype SandboxContext struct {\n\t// contains filtered or unexported fields\n}\n```\nSandboxContext and other structs form the implementation of the SandboxAPI interface defined in interop/sandbox\\_model.go, using the implementation of Init, Invoke and Reset handlers in rapid/sandbox.go\n\n```go\nfunc (s SandboxContext) Init(init *interop.Init, timeoutMs int64) interop.InitContext\n```\nInit starts the runtime domain initialization in a separate goroutine. Return value indicates that init request has been accepted and started.\n\n```go\nfunc (s SandboxContext) Reset(reset *interop.Reset) (interop.ResetSuccess, *interop.ResetFailure)\n```\nReset triggers a reset. In case of timeouts, the reset handler cancels all flows which triggers ongoing invoke handlers to return before proceeding with invoke TODO: move this method to the initialization context, since reset is conceptually on RT domain\n\n```go\nfunc (s SandboxContext) Restore(restore *interop.Restore) (interop.RestoreResult, error)\n```\n\n```go\nfunc (s *SandboxContext) SetInvokeResponseMetrics(metrics *interop.InvokeResponseMetrics)\n```\n\n```go\nfunc (s *SandboxContext) SetRuntimeStartedTime(runtimeStartedTime int64)\n```\n\n```go\nfunc (s SandboxContext) Shutdown(shutdown *interop.Shutdown) interop.ShutdownSuccess\n```\nReset triggers a shutdown. This is similar to a reset, except that this is a terminal state and no further invokes are allowed\n\n```go\ntype Server struct {\n\tInternalStateGetter interop.InternalStateGetter\n\n\tInitDoneChan     chan DoneWithState\n\tInvokeDoneChan   chan DoneWithState\n\tResetDoneChan    chan *interop.Done\n\tShutdownDoneChan chan *interop.Done\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewServer() *Server\n```\n\n```go\nfunc (s *Server) AwaitInitialized() error\n```\nAwaitInitialized waits until init is complete. It must be idempotent, since it can be called twice when a caller wants to wait until init is complete\n\n```go\nfunc (s *Server) AwaitRelease() (*statejson.ReleaseResponse, error)\n```\n\n```go\nfunc (s *Server) Clear()\n```\n\n```go\nfunc (s *Server) CurrentToken() *interop.Token\n```\n\n```go\nfunc (s *Server) FastInvoke(w http.ResponseWriter, i *interop.Invoke, direct bool) error\n```\n\n```go\nfunc (s *Server) GetCurrentInvokeID() string\n```\nGetCurrentInvokeID\n\n```go\nfunc (s *Server) GetInvokeContext() *InvokeContext\n```\n\n```go\nfunc (s *Server) GetInvokeTimeout() time.Duration\n```\n\n```go\nfunc (s *Server) Init(i *interop.Init, invokeTimeoutMs int64) error\n```\n\n```go\nfunc (s *Server) InternalState() (*statejson.InternalStateDescription, error)\n```\n\n```go\nfunc (s *Server) Invoke(responseWriter http.ResponseWriter, invoke *interop.Invoke) error\n```\nInvoke is used by the Runtime Interface Emulator (Rapid Local) [https://github.com/aws/aws-lambda-runtime-interface-emulator](https://github.com/aws/aws-lambda-runtime-interface-emulator)\n\n```go\nfunc (s *Server) Release() error\n```\nRelease closes the invocation, making server ready for reserve again\n\n```go\nfunc (s *Server) Reserve(id string, traceID, lambdaSegmentID string) (*ReserveResponse, error)\n```\nReserve allocates invoke context\n\n```go\nfunc (s *Server) Reset(reason string, timeoutMs int64) (*statejson.ResetDescription, error)\n```\n\n```go\nfunc (s *Server) Restore(restore *interop.Restore) (interop.RestoreResult, error)\n```\n\n```go\nfunc (s *Server) SendErrorResponse(invokeID string, resp *interop.ErrorInvokeResponse) error\n```\n\n```go\nfunc (s *Server) SendInitErrorResponse(resp *interop.ErrorInvokeResponse) error\n```\n\n```go\nfunc (s *Server) SendResponse(invokeID string, resp *interop.StreamableInvokeResponse) error\n```\n\n```go\nfunc (s *Server) SendRuntimeReady() error\n```\n\n```go\nfunc (s *Server) SetInternalStateGetter(cb interop.InternalStateGetter)\n```\nSetInternalStateGetter is used to set callback which returnes internal state for /test/internalState request\n\n```go\nfunc (s *Server) SetInvokeTimeout(timeout time.Duration)\n```\n\n```go\nfunc (s *Server) SetSandboxContext(sbCtx interop.SandboxContext)\n```\nSetSandboxContext is used to set the sandbox context after intiialization of interop server. After refactoring all messages, this needs to be removed and made an struct parameter on initialization.\n\n```go\nfunc (s *Server) Shutdown(shutdown *interop.Shutdown) *statejson.InternalStateDescription\n```\n\n","path":"github.com/aws/aws-lambda-runtime-interface-emulator/internal/lambda/rapidcore","name":"rapidcore","synopsis":"","isRedistributable":true}
