public static async Task <bool> PushPackage(
            this PackageSource source,
            CancellationToken ct,
            LocalPackage package,
            ILogger log
            )
        {
            await source
            .GetResource <PackageUpdateResource>()
            .Push(package.Path, null, 100, true, s => s, s => s, true, log);

            return(true);
        }
        public static async Task <DownloadResourceResult> DownloadPackage(
            this PackageSource source,
            CancellationToken ct,
            PackageIdentity identity,
            string downloadDirectory,
            ILogger log
            )
        {
            var downloadContext = new PackageDownloadContext(new SourceCacheContext {
                NoCache = true
            }, downloadDirectory, directDownload: true);

            return(await source
                   .GetResource <DownloadResource>()
                   .GetDownloadResourceResultAsync(identity, downloadContext, downloadDirectory, log, ct));
        }
        public static async Task <PackageSearchMetadataRegistration[]> GetPackageVersions(
            this PackageSource source,
            CancellationToken ct,
            string packageId
            )
        {
            var versions = await source
                           .GetResource <PackageMetadataResource>()
                           .GetMetadataAsync(packageId, true, false, new SourceCacheContext {
                NoCache = true
            }, NullLogger.Instance, ct);

            return(versions
                   .Cast <PackageSearchMetadataRegistration>()
                   .ToArray());
        }