Exemple #1
0
        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);
        }
Exemple #2
0
        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);
        }
Exemple #3
0
            public void GetPackageUrlAsync(string package, Action <string, Exception> callback)
            {
                PackageUrlRequest request = new PackageUrlRequest {
                    Package = package
                };

                PostAsync(SControllerName, nameof(IFileUrlController.PackageUrl), null, request, callback);
            }
Exemple #4
0
 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);
     }
 }