-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
509 additions
and
147 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
namespace NATS.Client.KeyValueStore; | ||
|
||
public record NatsKVConfig | ||
{ | ||
public NatsKVConfig(string bucket) => Bucket = bucket; | ||
|
||
/// <summary> | ||
/// Name of the bucket | ||
/// </summary> | ||
public string Bucket { get; init; } | ||
|
||
/// <summary> | ||
/// Human readable description. | ||
/// </summary> | ||
public string? Description { get; init; } | ||
|
||
/// <summary> | ||
/// Maximum size of a single value. | ||
/// </summary> | ||
public int MaxValueSize { get; init; } | ||
|
||
/// <summary> | ||
/// Maximum historical entries. | ||
/// </summary> | ||
public long History { get; init; } | ||
|
||
/// <summary> | ||
/// Maximum age of any entry in the bucket, expressed in nanoseconds | ||
/// </summary> | ||
public TimeSpan MaxAge { get; init; } | ||
|
||
/// <summary> | ||
/// How large the bucket may become in total bytes before the configured discard policy kicks in | ||
/// </summary> | ||
public long MaxBytes { get; init; } | ||
|
||
/// <summary> | ||
/// The type of storage backend, `File` (default) and `Memory` | ||
/// </summary> | ||
public NatsKVStorageType Storage { get; init; } | ||
|
||
/// <summary> | ||
/// How many replicas to keep for each entry in a cluster. | ||
/// </summary> | ||
public int NumberOfReplicas { get; init; } | ||
|
||
/// <summary> | ||
/// Republish is for republishing messages once persistent in the Key Value Bucket. | ||
/// </summary> | ||
public NatsKVRepublish? Republish { get; init; } | ||
|
||
// Bucket mirror configuration. | ||
// pub mirror: Option<Source>, | ||
// Bucket sources configuration. | ||
// pub sources: Option<Vec<Source>>, | ||
// Allow mirrors using direct API. | ||
// pub mirror_direct: bool, | ||
} | ||
|
||
public record NatsKVRepublish | ||
{ | ||
/// <summary> | ||
/// Subject that should be republished. | ||
/// </summary> | ||
public string? Src { get; init; } | ||
|
||
/// <summary> | ||
/// Subject where messages will be republished. | ||
/// </summary> | ||
public string? Dest { get; init; } | ||
|
||
/// <summary> | ||
/// If true, only headers should be republished. | ||
/// </summary> | ||
public bool HeadersOnly { get; init; } | ||
} |
Oops, something went wrong.