Documentation ¶
Overview ¶
Package prune provides types that remove messages from topics that have fallen outside their retention period.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConsumerPruner ¶
type ConsumerPruner interface {
Prune(ctx context.Context, topic string, before time.Time) ([]string, error)
}
The ConsumerPruner interface describes types that can reset consumer indexes for a topic. It should return the names of all consumers on a topic that have been pruned as the first return value.
type MessagePruner ¶
type MessagePruner interface { // Prune should remove all messages from a topic older than the before time. It should return the // count of all pruned messages as the first return value. Prune(ctx context.Context, topic string, before time.Time) (uint64, error) }
The MessagePruner interface describes types that can remove messages from a topic.
type Pruner ¶
type Pruner struct {
// contains filtered or unexported fields
}
The Pruner type is responsible for periodically removing messages from topics that are outside the topic's configured retention period.
func New ¶
func New(topics TopicLister, messages MessagePruner, consumers ConsumerPruner, logger hclog.Logger) *Pruner
New returns a new instance of the Pruner type that will list topics via the TopicLister implementation and prune messages via the MessagePruner implementation.
type TopicLister ¶
type TopicLister interface { // List should return a slice of all topics known to the current node. List(ctx context.Context) ([]*topic.Topic, error) }
The TopicLister interface describes types that can list all known topics.