Skip to content

Commit

Permalink
[IMPROVED] Export nested ConsumerManager interface (#1543)
Browse files Browse the repository at this point in the history
Signed-off-by: Piotr Piotrowski <piotr@synadia.com>
  • Loading branch information
piotrpio committed Feb 14, 2024
1 parent 62a6489 commit 373f09c
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions jetstream/stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@ import (
)

type (
// Stream contains CRUD methods on a consumer, as well as operations on an existing stream.
// It allows fetching and removing messages from a stream, as well as purging a stream.
// Stream contains CRUD methods on a consumer via [ConsumerManager], as well
// as operations on an existing stream. It allows fetching and removing
// messages from a stream, as well as purging a stream.
Stream interface {
streamConsumerManager
ConsumerManager

// Info returns StreamInfo from the server.
Info(ctx context.Context, opts ...StreamInfoOpt) (*StreamInfo, error)
Expand Down Expand Up @@ -60,7 +61,12 @@ type (
SecureDeleteMsg(ctx context.Context, seq uint64) error
}

streamConsumerManager interface {
// ConsumerManager provides CRUD API for managing consumers. It is
// available as a part of [Stream] interface. CreateConsumer,
// UpdateConsumer, CreateOrUpdateConsumer and Consumer methods return a
// [Consumer] interface, allowing to operate on a consumer (e.g. consume
// messages).
ConsumerManager interface {
// CreateOrUpdateConsumer creates a consumer on a given stream with
// given config. If consumer already exists, it will be updated (if
// possible). Consumer interface is returned, allowing to operate on a
Expand Down

0 comments on commit 373f09c

Please sign in to comment.