internal RuntimeApiClient(IEnvironmentVariables environmentVariables, HttpClient httpClient)
        {
            ExceptionConverter = ExceptionInfo.GetExceptionInfo;
            _httpClient        = httpClient;
            LambdaEnvironment  = new LambdaEnvironment(environmentVariables);
            var internalClient = new InternalRuntimeApiClient(httpClient);

            internalClient.BaseUrl = "http://" + LambdaEnvironment.RuntimeServerHostAndPort + internalClient.BaseUrl;
            _internalClient        = internalClient;
        }
Beispiel #2
0
        public LambdaContext(RuntimeApiHeaders runtimeApiHeaders, LambdaEnvironment lambdaEnvironment)
        {
            _lambdaEnvironment = lambdaEnvironment;
            _runtimeApiHeaders = runtimeApiHeaders;

            int.TryParse(_lambdaEnvironment.FunctionMemorySize, out _memoryLimitInMB);
            long.TryParse(_runtimeApiHeaders.DeadlineMs, out _deadlineMs);
            _cognitoIdentityLazy      = new Lazy <CognitoIdentity>(() => CognitoIdentity.FromJson(runtimeApiHeaders.CognitoIdentityJson));
            _cognitoClientContextLazy = new Lazy <CognitoClientContext>(() => CognitoClientContext.FromJson(runtimeApiHeaders.ClientContextJson));

            // set environment variable so that if the function uses the XRay client it will work correctly
            _lambdaEnvironment.SetXAmznTraceId(_runtimeApiHeaders.TraceId);
        }
 internal RuntimeApiClient(IEnvironmentVariables environmentVariables, IInternalRuntimeApiClient internalClient)
 {
     LambdaEnvironment  = new LambdaEnvironment(environmentVariables);
     _internalClient    = internalClient;
     ExceptionConverter = ExceptionInfo.GetExceptionInfo;
 }
Beispiel #4
0
 public LambdaContext(RuntimeApiHeaders runtimeApiHeaders, LambdaEnvironment lambdaEnvironment)
     : this(runtimeApiHeaders, lambdaEnvironment, new DateTimeHelper())
 {
 }
Beispiel #5
0
 public LambdaContext(RuntimeApiHeaders runtimeApiHeaders, LambdaEnvironment lambdaEnvironment, IConsoleLoggerWriter consoleLogger)
     : this(runtimeApiHeaders, lambdaEnvironment, new DateTimeHelper(), consoleLogger)
 {
 }