Exemplo n.º 1
0
        public FastDFSApiClient(IConfiguration configuration)
        {
            this.configuration = configuration;

            var ip    = configuration[$"FastDFS:IP"].Replace("{WebServerIP}", Modobay.AppManager.WebServerIP);
            var port  = int.Parse(configuration[$"FastDFS:Port"]);
            var group = configuration[$"FastDFS:Group"];

            client = new FastDfsClient(new List <IPEndPoint>
            {
                new IPEndPoint(IPAddress.Parse(ip), port)
            });

            try
            {
                storageNode = FastDfsClient.GetStorageNode("group1");
            }
            catch (Exception ex) { Lib.Log.WriteExceptionLog($"FastDFSApiClient:Message:{ex.Message}  <br> StackTrace:{ex.StackTrace}"); }
        }
Exemplo n.º 2
0
 public void GetNotExistNode(string groupName)
 {
     Assert.Throws <FdfsException>(() => { FastDfsClient.GetStorageNode(groupName); });
 }
Exemplo n.º 3
0
        public void DownloadNotExistFile(string groupName, string fileName)
        {
            var storageNode = FastDfsClient.GetStorageNode(groupName);

            Assert.Null(_client.DownloadFile(storageNode, fileName));
        }
 public ZaabyFastDfsClient(List<IPEndPoint> trackers, string groupName, IRepository repository = null)
 {
     _fastDfsClient = new FastDfsClient(trackers);
     _groupName = groupName;
     _repository = repository;
 }
Exemplo n.º 5
0
 public FastDfsProvider(FastDfsOption option)
 {
     _provider = new FastDfsClientProvider(option);
     _client   = _provider.GetClient();
 }