Documentation
¶
Index ¶
- Constants
- Variables
- func ParseStreamTimestamp(id string) (*time.Time, error)
- type DLQMessage
- type DLQService
- func (d *DLQService) DeleteMessage(ctx context.Context, id string) error
- func (d *DLQService) GetMessage(ctx context.Context, id string) (*DLQMessage, error)
- func (d *DLQService) GetMessages(ctx context.Context, opts PaginationOpts) (*MessageList[DLQMessage], error)
- func (d *DLQService) GetStats(ctx context.Context) (*StreamInfo, error)
- func (d *DLQService) RequeueAll(ctx context.Context) (int64, error)
- func (d *DLQService) RequeueMessage(ctx context.Context, id string, payload map[string]any) error
- type Message
- type MessageList
- type Monitor
- type PaginationOpts
- type RedisStream
- func (r *RedisStream) AddMessage(ctx context.Context, stream string, data map[string]any) (string, error)
- func (r *RedisStream) DeleteMessage(ctx context.Context, stream, id string) error
- func (r *RedisStream) GetMemoryUsage(ctx context.Context, stream string) (int64, error)
- func (r *RedisStream) GetStreamInfo(ctx context.Context, stream string) (*redis.XInfoStream, error)
- func (r *RedisStream) GetStreamLength(ctx context.Context, stream string) (int64, error)
- func (r *RedisStream) ReadMessage(ctx context.Context, stream, id string) (*redis.XMessage, error)
- func (r *RedisStream) ReadMessages(ctx context.Context, stream string, opts PaginationOpts) ([]redis.XMessage, error)
- func (r *RedisStream) ScanStreams(ctx context.Context) ([]string, error)
- type SortOrder
- type StatsOverview
- type StreamDetail
- type StreamInfo
- type StreamService
- func (s *StreamService) DeleteMessage(ctx context.Context, stream, id string) error
- func (s *StreamService) GetMessage(ctx context.Context, stream, id string) (*Message, error)
- func (s *StreamService) GetStreamDetail(ctx context.Context, stream string) (*StreamDetail, error)
- func (s *StreamService) GetStreamMessages(ctx context.Context, stream string, opts PaginationOpts) (*MessageList[Message], error)
- func (s *StreamService) GetStreams(ctx context.Context) ([]StreamInfo, error)
- type WatermillMessage
Constants ¶
View Source
const ( WatermillUUIDKey = "_watermill_message_uuid" WatermillPayloadKey = "payload" WatermillMetadataKey = "metadata" )
Watermill message keys
View Source
const ( ReasonPoisonedKey = "reason_poisoned" TopicPoisonedKey = "topic_poisoned" HandlerPoisonedKey = "handler_poisoned" SubscriberPoisonedKey = "subscriber_poisoned" )
Watermill PoisonQueue metadata keys
Variables ¶
View Source
var ErrInvalidSortOrder = errors.New("not a valid SortOrder")
Functions ¶
Types ¶
type DLQMessage ¶
type DLQService ¶
type DLQService struct {
// contains filtered or unexported fields
}
func NewDLQService ¶
func NewDLQService(monitor *RedisStream, dlqName string) *DLQService
func (*DLQService) DeleteMessage ¶
func (d *DLQService) DeleteMessage(ctx context.Context, id string) error
func (*DLQService) GetMessage ¶
func (d *DLQService) GetMessage(ctx context.Context, id string) (*DLQMessage, error)
func (*DLQService) GetMessages ¶
func (d *DLQService) GetMessages(ctx context.Context, opts PaginationOpts) (*MessageList[DLQMessage], error)
func (*DLQService) GetStats ¶
func (d *DLQService) GetStats(ctx context.Context) (*StreamInfo, error)
func (*DLQService) RequeueAll ¶
func (d *DLQService) RequeueAll(ctx context.Context) (int64, error)
func (*DLQService) RequeueMessage ¶
type MessageList ¶
type Monitor ¶
type Monitor struct {
// contains filtered or unexported fields
}
func (*Monitor) DLQ ¶
func (m *Monitor) DLQ() *DLQService
func (*Monitor) GetOverview ¶
func (m *Monitor) GetOverview(ctx context.Context) (*StatsOverview, error)
func (*Monitor) Streams ¶
func (m *Monitor) Streams() *StreamService
type PaginationOpts ¶
func (PaginationOpts) WithDefaults ¶
func (p PaginationOpts) WithDefaults() PaginationOpts
type RedisStream ¶
type RedisStream struct {
// contains filtered or unexported fields
}
func NewRedisStream ¶
func NewRedisStream(client redis.UniversalClient) *RedisStream
func (*RedisStream) AddMessage ¶
func (*RedisStream) DeleteMessage ¶
func (r *RedisStream) DeleteMessage(ctx context.Context, stream, id string) error
func (*RedisStream) GetMemoryUsage ¶
func (*RedisStream) GetStreamInfo ¶
func (r *RedisStream) GetStreamInfo(ctx context.Context, stream string) (*redis.XInfoStream, error)
func (*RedisStream) GetStreamLength ¶
func (*RedisStream) ReadMessage ¶
func (*RedisStream) ReadMessages ¶
func (r *RedisStream) ReadMessages(ctx context.Context, stream string, opts PaginationOpts) ([]redis.XMessage, error)
func (*RedisStream) ScanStreams ¶
func (r *RedisStream) ScanStreams(ctx context.Context) ([]string, error)
type SortOrder ¶
type SortOrder string
ENUM(asc, desc)
func ParseSortOrder ¶
ParseSortOrder attempts to convert a string to a SortOrder.
func (*SortOrder) AppendText ¶
AppendText appends the textual representation of itself to the end of b (allocating a larger slice if necessary) and returns the updated slice.
Implementations must not retain b, nor mutate any bytes within b[:len(b)].
func (SortOrder) IsValid ¶
IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values
func (SortOrder) MarshalText ¶
MarshalText implements the text marshaller method.
func (*SortOrder) UnmarshalText ¶
UnmarshalText implements the text unmarshaller method.
type StatsOverview ¶
type StreamDetail ¶
type StreamDetail struct {
StreamInfo
FirstEntryID *string `json:"first_entry_id,omitempty"`
}
type StreamInfo ¶
type StreamService ¶
type StreamService struct {
// contains filtered or unexported fields
}
func NewStreamService ¶
func NewStreamService(monitor *RedisStream, dlqName string) *StreamService
func (*StreamService) DeleteMessage ¶
func (s *StreamService) DeleteMessage(ctx context.Context, stream, id string) error
func (*StreamService) GetMessage ¶
func (*StreamService) GetStreamDetail ¶
func (s *StreamService) GetStreamDetail(ctx context.Context, stream string) (*StreamDetail, error)
func (*StreamService) GetStreamMessages ¶
func (s *StreamService) GetStreamMessages(ctx context.Context, stream string, opts PaginationOpts) (*MessageList[Message], error)
func (*StreamService) GetStreams ¶
func (s *StreamService) GetStreams(ctx context.Context) ([]StreamInfo, error)
type WatermillMessage ¶
func ParseWatermillMessage ¶
func ParseWatermillMessage(values map[string]any) (*WatermillMessage, error)
Click to show internal directories.
Click to hide internal directories.