Files
GiteaPublish/GiteaPublish/Gitea/IPackageRepo.cs
T
2026-02-14 16:19:46 -06:00

31 lines
1.8 KiB
C#

namespace GiteaPublish.Gitea;
public interface IPackageRepo
{
/// <summary>
/// Publishes a package to the specified repository. The filePath should point to the package file (e.g., .nupkg for NuGet). The method returns true if the package was published successfully, and false otherwise.
/// </summary>
/// <param name="owner">The owner of the repository</param>
/// <param name="repository">The name of the repository</param>
/// <param name="filePath">The path to the package file</param>
/// <returns>A bool representing whether the task was successful</returns>
public Task<bool> PublishPackageAsync(string owner, string repository, string filePath, string baseUrl);
/// <summary>
/// Deletes a package from the specified repository. The method returns true if the package was deleted successfully, and false otherwise.
/// </summary>
/// <param name="owner">The owner of the repositoty</param>
/// <param name="repository">The name of the repository</param>
/// <param name="architecture">The package architecture</param>
/// <param name="packageName">The name of the package</param>
/// <param name="packageVersion">The version of the package</param>
/// <returns>A bool representing whether the task was successful</returns>
public Task<bool> DeletePackageAsync(string owner, string architecture, string packageName, string packageVersion, string baseUrl);
/// <summary>
/// Sets the authentication for the package repository. This method should be called before any operations that require authentication (e.g., publishing or deleting packages). The BasicAuthModel contains the necessary information for basic authentication, such as the username and password.
/// </summary>
/// <param name="basicAuth"></param>
public void SetAuthentication(BasicAuthModel basicAuth);
}