Skip to content

nigel-sampson/octokit.caching

Repository files navigation

Octokit.Caching

A decorator for Octokit.NET's IHttpClient that adds support for the caching of results and respecting etags.

Usage

There is an overload of the GitHubClient constructor that takes an IConnection. We use this to create a Connection where we inject our custom http client.

var connection = new Connection(
	new ProductHeaderValue("Ocotokit.Caching.Tests", "1.0.0"),
	GitHubClient.GitHubApiUrl,
	new InMemoryCredentialStore(new Credentials("token")),
	new CachingHttpClient(new HttpClientAdapter(), new NaiveInMemoryCache()),
	new SimpleJsonSerializer());

var client = new GitHubClient(connection);

CachingHttpClient takes an instance of ICache so you can injection your own custom caching behaviour.

About

Caching Http Backend for Octokit

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages