Skip to content

Latest commit

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Microsoft IDistributedCache implementation for Etcd key value store

  • IDistributedCache implementation for Etcd k/v store.
  • It's a preview version, any feedback welcome.
  • I still need to make a nuget out of it.

1. Build

Clone repository and build DLL. Include DLL in your projects.

How to use

Register with services:

builder.Services.AddEtcdCache(options =>{options.ConnectionString="http://localhost:2379";options.Username="root";options.Password="root";});

Inject into class:

publicclassMyClass{privatereadonlyIDistributedCache_distributedCache;publicMyClass(IDistributedCachedistributedCache){_distributedCache=distributedCache;}publicasyncTask<IActionResult>Write(stringkey,stringvalue){//Save to cacheawait_distributedCache.SetAsync(key,Encoding.UTF8.GetBytes(value),newDistributedCacheEntryOptions{AbsoluteExpirationRelativeToNow=TimeSpan.FromMinutes(10)});//Read from cachevarcachedValue=await_distributedCache.GetAsync(key);}

About

IDistributedCache implementation for Etcd k/v store

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages