feat: add jetstream stream lifecycle api
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
using NATS.Server.JetStream.Models;
|
||||
|
||||
namespace NATS.Server.JetStream.Api;
|
||||
|
||||
public sealed class JetStreamApiResponse
|
||||
@@ -16,31 +18,24 @@ public sealed class JetStreamApiResponse
|
||||
};
|
||||
|
||||
public static JetStreamApiResponse Ok() => new();
|
||||
|
||||
public static JetStreamApiResponse ErrorResponse(int code, string description) => new()
|
||||
{
|
||||
Error = new JetStreamApiError
|
||||
{
|
||||
Code = code,
|
||||
Description = description,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
public sealed class JetStreamStreamInfo
|
||||
{
|
||||
public required JetStreamStreamConfig Config { get; init; }
|
||||
public required JetStreamStreamState State { get; init; }
|
||||
public required StreamConfig Config { get; init; }
|
||||
public required StreamState State { get; init; }
|
||||
}
|
||||
|
||||
public sealed class JetStreamConsumerInfo
|
||||
{
|
||||
public required JetStreamConsumerConfig Config { get; init; }
|
||||
}
|
||||
|
||||
public sealed class JetStreamStreamConfig
|
||||
{
|
||||
public string Name { get; init; } = string.Empty;
|
||||
}
|
||||
|
||||
public sealed class JetStreamStreamState
|
||||
{
|
||||
public ulong Messages { get; init; }
|
||||
public ulong FirstSeq { get; init; }
|
||||
}
|
||||
|
||||
public sealed class JetStreamConsumerConfig
|
||||
{
|
||||
public string DurableName { get; init; } = string.Empty;
|
||||
public required ConsumerConfig Config { get; init; }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user