LiteCache 1.0.10
dotnet add package LiteCache --version 1.0.10
NuGet\Install-Package LiteCache -Version 1.0.10
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="LiteCache" Version="1.0.10" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="LiteCache" Version="1.0.10" />
<PackageReference Include="LiteCache" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add LiteCache --version 1.0.10
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: LiteCache, 1.0.10"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=LiteCache&version=1.0.10
#tool nuget:?package=LiteCache&version=1.0.10
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
LiteCache
基于.net core显示的轻量级跨平台缓存库,支持实时本地化缓存,使用ProtoBuf net库实现的序列化和反序列化,任何对象都可以存储并且可设置有效期限,确保在停机后快速的恢复缓存.
A lightweight, cross-platform cache based on.net core display that supports real-time localization caching, serialization and deserialization using the Google protobuf-net library, any object can be stored and valid for a period of time to ensure quick recovery after an outage.
Nuget
https://www.nuget.org/packages/LiteCache/
dotnet add package LiteCache --version 1.0.10
Install-Package LiteCache -Version 1.0.10
示例(simple example)
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Threading;
using System.Threading.Tasks;
using Lsy.core.LiteCache;
using ProtoBuf;
namespace example {
class Program {
static void Main (string[] args) {
var cache = new LiteCache<Person> (60, 30, "mycache");
while (true) {
Console.WriteLine ("Please enter the keyboard number and press enter to confirm");
Console.WriteLine ("1:creat,2:query,3:Count,4:Flush");
var input_number = Console.ReadLine ();
switch (input_number) {
case "1":
Console.WriteLine ("you creat data,For example:zj,30,0");
var input_creat = Console.ReadLine ();
var ary = input_creat.Split (',');
var newPerson = new Person () { Name = ary[0], Age = int.Parse (ary[1]), Gender = int.Parse (ary[2]) };
var set_result = cache.AddValue (newPerson);
if (set_result.Item2) {
Console.WriteLine ("creat data complete,guid=" + set_result.Item1);
} else {
Console.WriteLine ("creat data error");
}
break;
case "2":
Console.WriteLine ("you query data,input guid key");
var input_query = Console.ReadLine ();
var result = cache.GetValue (input_query);
if (result.Item2) {
Console.WriteLine ($"data query complete,name:{result.Item1.Name},age:{result.Item1.Age}");
} else {
Console.WriteLine ("not data for query");
}
break;
case "3":
Console.WriteLine ("data count=" + cache.Count);
break;
case "4":
if (cache.Flush ()) {
Console.WriteLine ("flush data complete");
}
break;
}
}
}
}
[ProtoContract]
public class Person {
public string Name;
public int Age;
public int Gender;
}
}
版权
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. 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 was computed. 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. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.0
- protobuf-net (>= 1.0.10)
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 |
---|---|---|
1.0.10 | 1,009 | 9/5/2018 |