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}"); } }
public void GetNotExistNode(string groupName) { Assert.Throws <FdfsException>(() => { FastDfsClient.GetStorageNode(groupName); }); }
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; }
public FastDfsProvider(FastDfsOption option) { _provider = new FastDfsClientProvider(option); _client = _provider.GetClient(); }