CacheLiteSharp 1.1.0

A variety of cache implementations, all in .NET C#

Install-Package CacheLiteSharp -Version 1.1.0
dotnet add package CacheLiteSharp --version 1.1.0
<PackageReference Include="CacheLiteSharp" Version="1.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add CacheLiteSharp --version 1.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

CacheLiteSharp

Build Status

📂 A variety of cache implementations, all in .NET C#

Primarily influenced by the Kotlin-based Cache-Lite over at Kid the Programmer

Cache implementations include Perpetual, Least Recently Used, and Expirable.

This is mainly an academic exercise, however, feel entirely free to use this class library in your own projects, and please let me know the results of said attempt. This library comes in a handy nuget package for the bold in question.

Interface

All caches in this library implement the following simplistic interface, with slight variations on flush strategy inherent to said implementation:

    public interface ICache<T> where T : class
    {
        /// <summary>
        /// Obtain the size of the Cache in integer form
        /// </summary>
        int Size { get; }

        /// <summary>
        /// Set a generic cache value based on a string key 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="value"></param>
        void Set(string key, T value);

        /// <summary>
        /// Get a particular cache value using a string key
        /// </summary>
        /// <param name="key"></param>
        /// <returns></returns>
        T Get(string key);

        /// <summary>
        /// Remove a particular cache value using a string key
        /// </summary>
        /// <param name="key"></param>
        /// <returns></returns>
        T Remove(string key);

        /// <summary>
        /// Clear the entire cache
        /// </summary>
        void Clear();
    }

CacheLiteSharp

Build Status

📂 A variety of cache implementations, all in .NET C#

Primarily influenced by the Kotlin-based Cache-Lite over at Kid the Programmer

Cache implementations include Perpetual, Least Recently Used, and Expirable.

This is mainly an academic exercise, however, feel entirely free to use this class library in your own projects, and please let me know the results of said attempt. This library comes in a handy nuget package for the bold in question.

Interface

All caches in this library implement the following simplistic interface, with slight variations on flush strategy inherent to said implementation:

    public interface ICache<T> where T : class
    {
        /// <summary>
        /// Obtain the size of the Cache in integer form
        /// </summary>
        int Size { get; }

        /// <summary>
        /// Set a generic cache value based on a string key 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="value"></param>
        void Set(string key, T value);

        /// <summary>
        /// Get a particular cache value using a string key
        /// </summary>
        /// <param name="key"></param>
        /// <returns></returns>
        T Get(string key);

        /// <summary>
        /// Remove a particular cache value using a string key
        /// </summary>
        /// <param name="key"></param>
        /// <returns></returns>
        T Remove(string key);

        /// <summary>
        /// Clear the entire cache
        /// </summary>
        void Clear();
    }

Release Notes

Initial release.

Dependencies

This package has no dependencies.

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.1.0 177 7/18/2018
1.0.0 188 7/18/2018