Skip to content

Commit

Permalink
docs: update document [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
catcherwong committed Jan 1, 2023
1 parent 9319b1b commit 1fd9023
Show file tree
Hide file tree
Showing 6 changed files with 159 additions and 9 deletions.
3 changes: 3 additions & 0 deletions docs/BinaryFormatter.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ Because [EnyimMemcachedCore](https://github.com/cnblogs/EnyimMemcachedCore) use

Also, EnyimMemcachedCore implements BinaryFormatterTranscoder based on BinaryFormatter.

Important NOTE:

BinaryFormatter was removed by EasyCaching v1.7.0, due to after version .net 5 , it will no longer support.
84 changes: 84 additions & 0 deletions docs/FasterKv.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# DefaultFasterKvCachingProvider

FasterKv is a hybrid memory and disk Kv Store, so it can support much larger data storage than memory.

EasyCaching.FasterKv is a lib that is based on **EasyCaching.Core** and **Microsoft.FASTER.Core**.


# How to use ?

## 1. Install the package via Nuget

```
Install-Package EasyCaching.FasterKv
```

## 2. Config in Startup class

```csharp
public class Startup
{
//...
public void ConfigureServices(IServiceCollection services)
{
services.AddMvc();

services.AddEasyCaching(option =>
{
//use fasterkv cache
option.UseFasterKv(config =>
{
// fasterKv must be set SerializerName
config.SerializerName = "msg";
})
.WithMessagePack("msg");
});
}
}
```

### 3. Call the EasyCachingProvider

The following code show how to use EasyCachingProvider in ASP.NET Core Web API.

```csharp
[Route("api/[controller]")]
public class ValuesController : Controller
{
private readonly IEasyCachingProvider _provider;

public ValuesController(IEasyCachingProvider provider)
{
this._provider = provider;
}

[HttpGet]
public string Get()
{
//Remove
_provider.Remove("demo");

//Set
_provider.Set("demo", "123", TimeSpan.FromMinutes(1));

//Get
var res = _provider.Get("demo", () => "456", TimeSpan.FromMinutes(1));

//Get without data retriever
var res = _provider.Get<string>("demo");

//Remove Async
await _provider.RemoveAsync("demo");

//Set Async
await _provider.SetAsync("demo", "123", TimeSpan.FromMinutes(1));

//Get Async
var res = await _provider.GetAsync("demo",async () => await Task.FromResult("456"), TimeSpan.FromMinutes(1));

//Get without data retriever Async
var res = await _provider.GetAsync<string>("demo");
}
}
```
38 changes: 38 additions & 0 deletions docs/MemoryPack.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# DefaultMemoryPackSerializer

DefaultMemoryPackSerializer is is a serializer based on **MemoryPack**.

# How to Use?

## Install the package via Nuget

```
Install-Package EasyCaching.Serialization.MemoryPack
```

## Configuration

```
public class Startup
{
//others...
public void ConfigureServices(IServiceCollection services)
{
services.AddEasyCaching(options =>
{
// with a default name [mempack]
options.WithMemoryPack();
// with a custom name [myname]
options.WithMemoryPack("myname");
// add some serialization settings
options.WithMemoryPack(x =>
{
x.StringEncoding = StringEncoding.Utf8;
}, "cus");
});
}
}
```
8 changes: 5 additions & 3 deletions docs/SerializerOverview.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ When we use distributed caching, it's inevitable to serialize the contents of th
How do you serialize the cached content? Normally, serializing an object to byte[] would be the first choice. This is also the implementation of EasyCaching.

Serialization use
EasyCaching currently offers 4 serialization options, BinaryFormatter, Json, MessagePack and Protobuf.
EasyCaching currently offers 5 serialization options, Newtonsoft.Json, MessagePack, System.Text.Json, MemoryPack and Protobuf.

The BinaryFormatter is the default, without adding any third-party serialized packages.
~~The BinaryFormatter is the default, without adding any third-party serialized packages.~~

There is a Breaking Change you should take a look.

> In the version of < 0.6.0, only one serialization method can be used. Since EasyCaching supports the creation of multiple different Provider instances, support for different serialization methods for different providers is essential, so >= 0.6.0 version, named serialization selection is supported.
> In the version of < 0.6.0, only one serialization method can be used. Since EasyCaching supports the creation of multiple different Provider instances, support for different serialization methods for different providers is essential, so >= 0.6.0 version, named serialization selection is supported.
> BinaryFormatter was removed by EasyCaching v1.7.0, due to after version .net 5 , it will no longer support.
33 changes: 27 additions & 6 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ EasyCaching is an open source caching library that contains basic usages and som

# Nuget Packages

## Provider

| Package Name | Version | Downloads
|--------------| ------- | ----
| EasyCaching.Core | ![](https://img.shields.io/nuget/v/EasyCaching.Core.svg) | ![](https://img.shields.io/nuget/dt/EasyCaching.Core.svg)
Expand All @@ -18,15 +20,34 @@ EasyCaching is an open source caching library that contains basic usages and som
| EasyCaching.SQLite | ![](https://img.shields.io/nuget/v/EasyCaching.SQLite.svg) | ![](https://img.shields.io/nuget/dt/EasyCaching.SQLite.svg)
| EasyCaching.Disk | ![](https://img.shields.io/nuget/v/EasyCaching.Disk.svg) | ![](https://img.shields.io/nuget/dt/EasyCaching.Disk.svg)
| EasyCaching.HybridCache | ![](https://img.shields.io/nuget/v/EasyCaching.HybridCache.svg) | ![](https://img.shields.io/nuget/dt/EasyCaching.HybridCache.svg)
| EasyCaching.Interceptor.Castle | ![](https://img.shields.io/nuget/v/EasyCaching.Interceptor.Castle.svg) | ![](https://img.shields.io/nuget/dt/EasyCaching.Interceptor.Castle.svg)
| EasyCaching.Interceptor.AspectCore | ![](https://img.shields.io/nuget/v/EasyCaching.Interceptor.AspectCore.svg) | ![](https://img.shields.io/nuget/dt/EasyCaching.Interceptor.AspectCore.svg)
| EasyCaching.ResponseCaching | ![](https://img.shields.io/nuget/v/EasyCaching.ResponseCaching.svg) | ![](https://img.shields.io/nuget/dt/EasyCaching.ResponseCaching.svg)
| EasyCaching.Disk | ![](https://img.shields.io/nuget/v/EasyCaching.Disk.svg) | ![](https://img.shields.io/nuget/dt/EasyCaching.Disk.svg)
| EasyCaching.LiteDB | ![](https://img.shields.io/nuget/v/EasyCaching.LiteDB.svg) | ![](https://img.shields.io/nuget/dt/EasyCaching.LiteDB.svg)
| EasyCaching.FasterKv | ![](https://img.shields.io/nuget/v/EasyCaching.FasterKv.svg) | ![](https://img.shields.io/nuget/dt/EasyCaching.FasterKv.svg)

## Serialization

| Package Name | Version | Downloads
|--------------| ------- | ----
| EasyCaching.Serialization.MessagePack | ![](https://img.shields.io/nuget/v/EasyCaching.Serialization.MessagePack.svg) | ![](https://img.shields.io/nuget/dt/EasyCaching.Serialization.MessagePack.svg)
| EasyCaching.Serialization.Json | ![](https://img.shields.io/nuget/v/EasyCaching.Serialization.Json.svg) | ![](https://img.shields.io/nuget/dt/EasyCaching.Serialization.Json.svg)
| EasyCaching.Serialization.Protobuf | ![](https://img.shields.io/nuget/v/EasyCaching.Serialization.Protobuf.svg) | ![](https://img.shields.io/nuget/dt/EasyCaching.Serialization.Protobuf.svg)
| EasyCaching.Serialization.SystemTextJson | ![](https://img.shields.io/nuget/v/EasyCaching.Serialization.SystemTextJson.svg) | ![](https://img.shields.io/nuget/dt/EasyCaching.Serialization.SystemTextJson.svg)
| EasyCaching.Serialization.MemoryPack | ![](https://img.shields.io/nuget/v/EasyCaching.Serialization.MemoryPack.svg) | ![](https://img.shields.io/nuget/dt/EasyCaching.Serialization.MemoryPack.svg)

## Bus

| Package Name | Version | Downloads
|--------------| ------- | ----
| EasyCaching.Bus.RabbitMQ | ![](https://img.shields.io/nuget/v/EasyCaching.Bus.RabbitMQ.svg) | ![](https://img.shields.io/nuget/dt/EasyCaching.Bus.RabbitMQ.svg)
| EasyCaching.Bus.Redis | ![](https://img.shields.io/nuget/v/EasyCaching.Bus.Redis.svg) | ![](https://img.shields.io/nuget/dt/EasyCaching.Bus.Redis.svg)
| EasyCaching.Bus.CSRedis | ![](https://img.shields.io/nuget/v/EasyCaching.Bus.CSRedis.svg) | ![](https://img.shields.io/nuget/dt/EasyCaching.Bus.CSRedis.svg)
| EasyCaching.ResponseCaching | ![](https://img.shields.io/nuget/v/EasyCaching.ResponseCaching.svg) | ![](https://img.shields.io/nuget/dt/EasyCaching.ResponseCaching.svg)
| EasyCaching.Disk | ![](https://img.shields.io/nuget/v/EasyCaching.Disk.svg) | ![](https://img.shields.io/nuget/dt/EasyCaching.Disk.svg)
| EasyCaching.LiteDB | ![](https://img.shields.io/nuget/v/EasyCaching.LiteDB.svg) | ![](https://img.shields.io/nuget/dt/EasyCaching.LiteDB.svg)
| EasyCaching.Serialization.SystemTextJson | ![](https://img.shields.io/nuget/v/EasyCaching.Serialization.SystemTextJson.svg) | ![](https://img.shields.io/nuget/dt/EasyCaching.Serialization.SystemTextJson.svg)
| EasyCaching.Bus.Zookeeper | ![](https://img.shields.io/nuget/v/EasyCaching.Bus.Zookeeper.svg) | ![](https://img.shields.io/nuget/dt/EasyCaching.Bus.Zookeeper.svg)
| EasyCaching.Bus.ConfluentKafka | ![](https://img.shields.io/nuget/v/EasyCaching.Bus.ConfluentKafka.svg) | ![](https://img.shields.io/nuget/dt/EasyCaching.Bus.ConfluentKafka.svg)

## Interceptor

| Package Name | Version | Downloads
|--------------| ------- | ----
| EasyCaching.Interceptor.Castle | ![](https://img.shields.io/nuget/v/EasyCaching.Interceptor.Castle.svg) | ![](https://img.shields.io/nuget/dt/EasyCaching.Interceptor.Castle.svg)
| EasyCaching.Interceptor.AspectCore | ![](https://img.shields.io/nuget/v/EasyCaching.Interceptor.AspectCore.svg) | ![](https://img.shields.io/nuget/dt/EasyCaching.Interceptor.AspectCore.svg)
2 changes: 2 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ pages:
- Hybird : Hybrid.md
- Disk : Disk.md
- LiteDB : LiteDB.md
- FasterKv: FasterKv.md
# - ProviderFactory : ProviderFactory.md
- Provider Factory:
- Overview : FactoryOverview.md
Expand All @@ -31,4 +32,5 @@ pages:
- NewtonsoftJson : NewtonsoftJson.md
- SystemTextJson : SystemTextJson.md
- Protobuf : ProtoBuf.md
- MemoryPack: MemoryPack.md

0 comments on commit 1fd9023

Please sign in to comment.