示例#1
0
 public MdDataOps(IMdNodeFactory nodeFactory, INetworkDataOps networkOps, MDataInfo mdInfo)
 {
     _mdInfo     = mdInfo;
     _imDStore   = new ImDStore(networkOps);
     Session     = networkOps.Session;
     NodeFactory = nodeFactory;
 }
示例#2
0
 public MdHeadManager(INetworkDataOps dataOps, IMdNodeFactory nodeFactory, string appId, ulong protocol, MdHeadPermissionSettings permissions = null)
 {
     APP_CONTAINER_PATH = $"apps/{appId}";
     _protocol          = protocol;
     _dataOps           = dataOps;
     _nodeFactory       = nodeFactory;
     _permissions       = permissions ?? new MdHeadPermissionSettings();
 }
示例#3
0
        internal async Task InitSession(Func <IImDStore, Snapshotter> snapShotterFactory, bool inMem = true, bool mock = true)
        {
            if (!mock)
            {
                throw new InvalidOperationException("Not testing against live networks.");
            }

            var mockClient = new CredentialAuth(_appId, inMem);
            var session    = (await mockClient.AuthenticateAsync()).Value;

            _networkDataOps = new NetworkDataOps(session);

            var snapshotter = snapShotterFactory == null ? null : snapShotterFactory(GetImdStore());

            _dbFactory       = new StreamDbFactory(_networkDataOps, snapshotter);
            _nodeFactory     = _dbFactory.NodeFactory;
            _dataTreeFactory = new DataTreeFactory(_nodeFactory);
        }
示例#4
0
 public ImDStore(INetworkDataOps networkOps)
 => _networkOps = networkOps;
示例#5
0
 public SAFEClient(string appId, INetworkDataOps networkDataOps, StreamDbFactory dbFactory)
 {
     _appId          = appId;
     _networkDataOps = networkDataOps;
     _dbFactory      = dbFactory;
 }
示例#6
0
 public MdNodeFactory(INetworkDataOps networkOps, Snapshots.Snapshotter snapshotter)
 {
     _networkOps  = networkOps;
     _snapshotter = snapshotter;
 }
示例#7
0
 public StreamDbFactory(INetworkDataOps dataOps, Snapshots.Snapshotter snapshotter)
 {
     _dataOps    = dataOps;
     NodeFactory = new MdNodeFactory(dataOps, snapshotter);
     _streamCollectionFactory = new StreamCollectionFactory(NodeFactory, new DataTreeFactory(NodeFactory));
 }