Initial import of the CBDDC codebase with docs and tests. Add a .NET-focused gitignore to keep generated artifacts out of source control.
Some checks failed
CI / verify (push) Has been cancelled

This commit is contained in:
Joseph Doherty
2026-02-20 13:03:21 -05:00
commit 08bfc17218
218 changed files with 33910 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
using System.Threading.Tasks;
namespace ZB.MOM.WW.CBDDC.Core.Cache
{
/// <summary>
/// Defines operations for caching documents by collection and key.
/// </summary>
public interface IDocumentCache
{
/// <summary>
/// Clears all cached documents.
/// </summary>
void Clear();
/// <summary>
/// Gets a cached document by collection and key.
/// </summary>
/// <param name="collection">The collection name.</param>
/// <param name="key">The document key.</param>
/// <returns>The cached document, or <see langword="null"/> if not found.</returns>
Task<Document?> Get(string collection, string key);
/// <summary>
/// Gets cache hit/miss statistics.
/// </summary>
/// <returns>A tuple containing hits, misses, current size, and hit rate.</returns>
(long Hits, long Misses, int Size, double HitRate) GetStatistics();
/// <summary>
/// Removes a cached document by collection and key.
/// </summary>
/// <param name="collection">The collection name.</param>
/// <param name="key">The document key.</param>
void Remove(string collection, string key);
/// <summary>
/// Adds or updates a cached document.
/// </summary>
/// <param name="collection">The collection name.</param>
/// <param name="key">The document key.</param>
/// <param name="document">The document to cache.</param>
/// <returns>A task that represents the asynchronous operation.</returns>
Task Set(string collection, string key, Document document);
}
}