Example #1
0
        public static ILocalLambdaRuntime Initialize(string directory, IAWSService awsService)
        {
            if (!Directory.Exists(directory))
            {
                throw new DirectoryNotFoundException($"Directory containing built Lambda project does not exist {directory}");
            }

            var depsFile = Directory.GetFiles(directory, "*.deps.json").FirstOrDefault();

            if (depsFile == null)
            {
                throw new Exception($"Failed to find a deps.json file in the specified directory ({directory})");
            }

            var fileName = depsFile.Substring(0, depsFile.Length - ".deps.json".Length) + ".dll";

            if (!File.Exists(fileName))
            {
                throw new Exception($"Failed to find Lambda project entry assembly in the specified directory ({directory})");
            }

            // The resolver provides the ability to load the assemblies containing the select Lambda function.
            var resolver = new LambdaAssemblyLoadContext(fileName);

            var runtime = new LocalLambdaRuntime(resolver, directory, awsService);

            return(runtime);
        }
Example #2
0
 public UploadController(FootageManager fm,
                         IFootageStorageService ifss,
                         IRegisteredDeviceService irds,
                         IAPIResultTypeService iapits,
                         IDeviceEventIntermediateService ideis,
                         IEventService ies,
                         IChannelContactService iccs,
                         IAWSService iawss,
                         IChannelService ics,
                         IStaffEventIntermediateService iseis,
                         IContactService icos
                         )
 {
     _FootageManager                 = fm;
     _FootageStorageService          = ifss;
     _RegisteredDeviceService        = irds;
     _APIResultTypeService           = iapits;
     _DeviceEventIntermediateService = ideis;
     _EventService                  = ies;
     _AWSService                    = iawss;
     _ChannelContactService         = iccs;
     _ChannelService                = ics;
     _StaffEventIntermediateService = iseis;
     _ContactService                = icos;
 }
Example #3
0
 public IniciaProceso(ILogger <IniciaProceso> logger, IAWSService aws_service, IDBService db_service, IFileService file_service, EnvVariables env_variables)
 {
     _logger       = logger;
     _awsService   = aws_service;
     _dbService    = db_service;
     _fileService  = file_service;
     _envVariables = env_variables;
 }
Example #4
0
 public FileService(ILogger <FileService> logger, INotificacionesService notificaciones_service,
                    IDBService dB_service, IAWSService aws_service, EnvVariables envVar)
 {
     _logger                = logger;
     _dbService             = dB_service;
     _envVariables          = envVar;
     _notificacionesService = notificaciones_service;
     _awsService            = aws_service;
 }
Example #5
0
 private LocalLambdaRuntime(LambdaAssemblyLoadContext lambdaContext, string lambdaAssemblyDirectory, IAWSService awsService)
 {
     LambdaContext = lambdaContext;
     this.LambdaAssemblyDirectory = lambdaAssemblyDirectory;
     this.AWSService = awsService;
 }