Exemplo n.º 1
0
        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;
        }
Exemplo n.º 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);
        }
Exemplo n.º 3
0
 internal RuntimeApiClient(IEnvironmentVariables environmentVariables, IInternalRuntimeApiClient internalClient)
 {
     LambdaEnvironment  = new LambdaEnvironment(environmentVariables);
     _internalClient    = internalClient;
     ExceptionConverter = ExceptionInfo.GetExceptionInfo;
 }
Exemplo n.º 4
0
 public LambdaContext(RuntimeApiHeaders runtimeApiHeaders, LambdaEnvironment lambdaEnvironment)
     : this(runtimeApiHeaders, lambdaEnvironment, new DateTimeHelper())
 {
 }
Exemplo n.º 5
0
 public LambdaContext(RuntimeApiHeaders runtimeApiHeaders, LambdaEnvironment lambdaEnvironment, IConsoleLoggerWriter consoleLogger)
     : this(runtimeApiHeaders, lambdaEnvironment, new DateTimeHelper(), consoleLogger)
 {
 }