コード例 #1
0
ファイル: Database.cs プロジェクト: fossabot/datatent
        public Database(ILoggerFactory loggerFactory, DatatentSettings settings, IDataProcessingPipeline processingPipeline)
        {
            _settings           = settings;
            _processingPipeline = processingPipeline;

            _fileSystemService = new FileSystemService(_settings, loggerFactory.CreateLogger <FileSystemService>());
            _defaultScheduler  = new DefaultScheduler(_fileSystemService);
        }
コード例 #2
0
ファイル: Database.cs プロジェクト: sebfischer83/datatent
        public static Database CreateNew(ILoggerFactory loggerFactory, string path, string password = "")
        {
            DatatentSettings settings = new DatatentSettings();

            settings.DataFile = path;
            IDataProcessingPipeline processingPipeline = new DataProcessingPipeline(new UTF8JSonSerializer(), string.IsNullOrWhiteSpace(password) ? (IEncryptionService) new NullEncryptionService() : new AESEncryptionService(password), new Lz4CompressionService());

            var database = new Database(loggerFactory, settings, processingPipeline);

            database.InitNew();

            return(database);
        }