{"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 rapi\n\n## Functions\n\n```go\nfunc CredentialsAPIRouter(credentialsService core.CredentialsService) http.Handler\n```\n\n```go\nfunc ExtensionsRouter(appCtx appctx.ApplicationContext, registrationService core.RegistrationService, renderingService *rendering.EventRenderingService) http.Handler\n```\nExtensionsRouter returns a new instance of chi router implementing Extensions Runtime API specification.\n\n```go\nfunc LogsAPIRouter(registrationService core.RegistrationService, logsSubscriptionAPI telemetry.SubscriptionAPI) http.Handler\n```\nLogsAPIRouter returns a new instance of chi router implementing Logs API specification.\n\n```go\nfunc LogsAPIStubRouter() http.Handler\n```\nLogsAPIStubRouter returns a new instance of chi router implementing a stub of Logs API that always returns a non-committal response to prevent customer code from crashing when Logs API is disabled locally\n\n```go\nfunc NewRouter(appCtx appctx.ApplicationContext, registrationService core.RegistrationService, renderingService *rendering.EventRenderingService) http.Handler\n```\nNewRouter returns a new instance of chi router implementing Runtime API specification.\n\n```go\nfunc SaveConnInContext(ctx context.Context, c net.Conn) context.Context\n```\n\n```go\nfunc TelemetryAPIRouter(registrationService core.RegistrationService, telemetrySubscriptionAPI telemetry.SubscriptionAPI) http.Handler\n```\nTelemetryRouter returns a new instance of chi router implementing Telemetry API specification.\n\n```go\nfunc TelemetryAPIStubRouter() http.Handler\n```\nTelemetryStubRouter returns a new instance of chi router implementing a stub of Telemetry API that always returns a non-committal response to prevent customer code from crashing when Telemetry API is disabled locally\n\n## Types\n\n```go\ntype Server struct {\n\t// contains filtered or unexported fields\n}\n```\nServer is a Runtime API server\n\n```go\nfunc NewServer(\n\thost string,\n\tport int,\n\tappCtx appctx.ApplicationContext,\n\tregistrationService core.RegistrationService,\n\trenderingService *rendering.EventRenderingService,\n\ttelemetryAPIEnabled bool,\n\tlogsSubscriptionAPI telemetry.SubscriptionAPI,\n\ttelemetrySubscriptionAPI telemetry.SubscriptionAPI,\n\tcredentialsService core.CredentialsService,\n\tmetadataService *lmds.Service,\n) *Server\n```\nNewServer creates a new Runtime API Server\n\nUnlike net/http server's ListenAndServe, we separate Listen() and Serve(), this is done to guarantee order: call to Listen() should happen before provided runtime is started.\n\nWhen port is 0, OS will dynamically allocate the listening port.\n\n```go\nfunc (s *Server) Close() error\n```\nClose forcefully closes listeners \u0026 connections\n\n```go\nfunc (s *Server) Host() string\n```\nHost is server's host\n\n```go\nfunc (s *Server) Listen() error\n```\nListen on port\n\n```go\nfunc (s *Server) Port() int\n```\nPort is server's port\n\n```go\nfunc (s *Server) Serve(ctx context.Context) error\n```\nServe requests and close on cancelation signals\n\n```go\nfunc (s *Server) Shutdown() error\n```\nShutdown gracefully shuts down server\n\n```go\nfunc (s *Server) URL(endpoint string) string\n```\nURL is full server url for specified endpoint\n\n","path":"github.com/aws/aws-lambda-runtime-interface-emulator/internal/lambda/rapi","name":"rapi","synopsis":"","isRedistributable":true}
