KallitheaApiClient 0.7.0.11
See the version list below for details.
dotnet add package KallitheaApiClient --version 0.7.0.11
NuGet\Install-Package KallitheaApiClient -Version 0.7.0.11
<PackageReference Include="KallitheaApiClient" Version="0.7.0.11" />
paket add KallitheaApiClient --version 0.7.0.11
#r "nuget: KallitheaApiClient, 0.7.0.11"
// Install KallitheaApiClient as a Cake Addin
#addin nuget:?package=KallitheaApiClient&version=0.7.0.11
// Install KallitheaApiClient as a Cake Tool
#tool nuget:?package=KallitheaApiClient&version=0.7.0.11
This is Kallithea API client library for .NET.
Kallithea is a self-hosted repository hosting WEB application.
It's a relatively simple mapper to the API's JSON interface, so it should be easy to match with the Kallithea API documentation.
Sorry, IntelliSense messages (documentation comments) for types and members are provided in Japanese. This is because I currently think that the main users are me and the people around me.
The first three parts of the package version represent the target version of Kallithea.
Be aware that if the versions do not match, the API specifications may not match.
The fourth revision value shows the version value of this library.
Therefore, unlike general library versioning, the difference in revision values is not necessarily a trivial change.
Example: Creation of users, repositories, etc.
var apiUrl = new Uri("http://<your-hosting-server>/_admin/api");
var apiKey = "<your-api-key>";
using var client = new KallitheaClient(apiUrl, apiKey);
await client.CreateUserAsync(new("foo", "foo@example.com", "family", "given", password: "foo123"));
await client.CreateUserGroupAsync(new("all"));
await client.AddUserToUserGroupAsync(new("all", "admin"));
await client.AddUserToUserGroupAsync(new("all", "foo"));
await client.CreateUserGroupAsync(new("tester"));
await client.AddUserToUserGroupAsync(new("tester", "foo"));
await client.CreateRepoGroupAsync(new("share"));
await client.GrantUserGroupPermToRepoGroupAsync(new("share", "tester", RepoGroupPerm.admin));
await client.CreateRepoGroupAsync(new("users"));
await client.CreateRepoGroupAsync(new("foo", parent: "users"));
await client.GrantUserPermToRepoGroupAsync(new("users/foo", "foo", RepoGroupPerm.admin));
await client.CreateRepoAsync(new("users/foo/repo1", owner: "foo", repo_type: RepoType.git));
await client.CreateRepoAsync(new("users/foo/repo2", owner: "foo", repo_type: RepoType.hg));
Example: Displays the most recent changesets for each repository.
var apiUrl = new Uri("http://<your-hosting-server>/_admin/api");
var apiKey = "<your-api-key>";
using var client = new SimpleKallitheaClient(apiUrl, apiKey);
var repositories = await client.GetReposAsync();
foreach (var repo in repositories)
{
Console.WriteLine($"{repo.repo_name}: RepoType={repo.repo_type}, Owner={repo.owner}");
try
{
var args = new GetChangesetsArgs(repo.repo_name, max_revisions: "3", reverse: true);
var changesets = await client.GetChangesetsAsync(args);
foreach (var change in changesets)
{
var msgline = change.summary.message?.Split('\r', '\n')[0].Trim();
Console.WriteLine($" {change.summary.short_id} : {msgline}");
}
}
catch (Exception ex)
{
Console.WriteLine($" Can't get changeset : {ex.Message}");
}
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. |
-
net6.0
- No dependencies.
-
net7.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
0.7.0.12-patch511b20a6475d | 41 | 5/13/2023 |
0.7.0.11 | 215 | 12/23/2022 |