Exemplo n.º 1
0
        public static async Task <Result <FileSystem> > CreateForSAFEApp(SafeApp.Session session, string appId, string root)
        {
            var manager = new MdHeadManager(session, appId, DataProtocol.DEFAULT_PROTOCOL);
            await manager.InitializeManager();

            MdAccess.SetCreator((level) => manager.CreateNewMdOps(level, DataProtocol.DEFAULT_PROTOCOL));
            MdAccess.SetLocator(manager.LocateMdOps);

            var dbResult = FileSystem.GetOrAdd(root);

            return(dbResult);
        }
Exemplo n.º 2
0
        public static async Task <Result <Database> > CreateForApp(SafeApp.Session session, string appId, string databaseId)
        {
            var manager = new MdHeadManager(session, appId, DataProtocol.DEFAULT_PROTOCOL);
            await manager.InitializeManager();

            MdAccess.SetCreator((level) => manager.CreateNewMdOps(level, DataProtocol.DEFAULT_PROTOCOL));
            MdAccess.SetLocator(manager.LocateMdOps);

            var indexerDbId   = $"{databaseId}_indexer";
            var indexerMdHead = await manager.GetOrAddHeadAsync(indexerDbId);

            var indexer = await Indexer.GetOrAddAsync(indexerMdHead);

            var databaseMdHead = await manager.GetOrAddHeadAsync(databaseId);

            var dbResult = await Database.GetOrAddAsync(databaseMdHead, indexer);

            return(dbResult);
        }
Exemplo n.º 3
0
 public SomeApp(SafeApp.Session session)
 => _session = session;
Exemplo n.º 4
0
 public SAFEClient(SafeApp.Session session, string appId)
 {
     _session = session;
     _appId   = appId;
 }