27 lines
693 B
C#
27 lines
693 B
C#
using System;
|
|
|
|
namespace StellaOps.Provcache;
|
|
|
|
public sealed partial class DecisionDigestBuilder
|
|
{
|
|
/// <summary>
|
|
/// Sets explicit timestamps for created and expires.
|
|
/// </summary>
|
|
public DecisionDigestBuilder WithTimestamps(DateTimeOffset createdAt, DateTimeOffset expiresAt)
|
|
{
|
|
_createdAt = createdAt;
|
|
_expiresAt = expiresAt;
|
|
return this;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Sets timestamps using the default TTL from options.
|
|
/// </summary>
|
|
public DecisionDigestBuilder WithDefaultTimestamps()
|
|
{
|
|
_createdAt = _timeProvider.GetUtcNow();
|
|
_expiresAt = _createdAt.Value.Add(_options.DefaultTtl);
|
|
return this;
|
|
}
|
|
}
|