public void GetPackageUrlAsync(string package, Action <string, Exception> callback) { PackageUrlRequest request = new PackageUrlRequest { Package = package }; JsonRpcRoot.PostAsync(RpcRoot.OfficialServerHost, RpcRoot.OfficialServerPort, _controllerName, nameof(IFileUrlController.PackageUrl), request, callback); }
public void GetPackageUrlAsync(string package, Action <string, Exception> callback) { PackageUrlRequest request = new PackageUrlRequest { Package = package }; RpcRoot.PostAsync(_host, _port, _controllerName, nameof(IFileUrlController.PackageUrl), request, callback); }
public void GetPackageUrlAsync(string package, Action <string, Exception> callback) { PackageUrlRequest request = new PackageUrlRequest { Package = package }; PostAsync(SControllerName, nameof(IFileUrlController.PackageUrl), null, request, callback); }
public string PackageUrl([FromBody] PackageUrlRequest request) { try { if (request == null || string.IsNullOrEmpty(request.Package)) { return(string.Empty); } return(AppRoot.NTMinerFileUrlGenerater.GeneratePresignedUrl("ntminer", $"packages/{request.Package}")); } catch (Exception e) { Logger.ErrorDebugLine(e); return(string.Empty); } }
public string PackageUrl([FromBody] PackageUrlRequest request) { try { if (request == null || string.IsNullOrEmpty(request.Package)) { return(string.Empty); } var req = new GeneratePresignedUriRequest("ntminer", $"packages/{request.Package}", SignHttpMethod.Get) { Expiration = DateTime.Now.AddMinutes(10) }; var uri = HostRoot.Instance.OssClient.GeneratePresignedUri(req); return(SignatureSafeUrl(uri)); } catch (Exception e) { Logger.ErrorDebugLine(e); return(string.Empty); } }