redisstream

package
v0.44.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 22, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package redisstream implements the `client "redis_stream"` block — a child of `client "redis"` that produces to and consumes from Redis Streams.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConsumerDef

type ConsumerDef struct {
	Name             string                       `hcl:",label"`
	Stream           hcl.Expression               `hcl:"stream"`
	Group            string                       `hcl:"group"`
	ConsumerName     hcl.Expression               `hcl:"consumer_name,optional"`
	VinculumTopic    hcl.Expression               `hcl:"vinculum_topic,optional"`
	Subscriber       hcl.Expression               `hcl:"subscriber,optional"`
	Action           hcl.Expression               `hcl:"action,optional"`
	Transforms       hcl.Expression               `hcl:"transforms,optional"`
	OnDecodeError    hcl.Expression               `hcl:"on_decode_error,optional"`
	QueueSize        *int                         `hcl:"queue_size,optional"`
	Baggage          *hclutil.BaggageFilterConfig `hcl:"baggage,block"`
	BatchSize        *int64                       `hcl:"batch_size,optional"`
	BlockTimeout     hcl.Expression               `hcl:"block_timeout,optional"`
	AutoAck          *bool                        `hcl:"auto_ack,optional"`
	GroupCreate      string                       `hcl:"group_create,optional"`
	PayloadField     *string                      `hcl:"payload_field,optional"`
	TopicField       *string                      `hcl:"topic_field,optional"`
	ContentTypeField *string                      `hcl:"content_type_field,optional"`
	FieldsMode       string                       `hcl:"fields_mode,optional"`
	ReclaimPending   *bool                        `hcl:"reclaim_pending,optional"`
	ReclaimMinIdle   hcl.Expression               `hcl:"reclaim_min_idle,optional"`
	DeadLetterStream string                       `hcl:"dead_letter_stream,optional"`
	DeadLetterAfter  *int64                       `hcl:"dead_letter_after,optional"`
	DefRange         hcl.Range                    `hcl:",def_range"`
}

type ProducerDef

type ProducerDef struct {
	Name                   string         `hcl:",label"`
	Stream                 hcl.Expression `hcl:"stream,optional"`
	MaxLen                 *int64         `hcl:"maxlen,optional"`
	ApproximateMaxLen      *bool          `hcl:"approximate_maxlen,optional"`
	DefaultStreamTransform string         `hcl:"default_stream_transform,optional"`
	PayloadField           *string        `hcl:"payload_field,optional"`
	TopicField             *string        `hcl:"topic_field,optional"`
	ContentTypeField       *string        `hcl:"content_type_field,optional"`
	FieldsMode             string         `hcl:"fields_mode,optional"`
	DefRange               hcl.Range      `hcl:",def_range"`
}

type RedisStreamClient

type RedisStreamClient struct {
	cfg.BaseClient
	bus.BaseSubscriber
	// contains filtered or unexported fields
}

RedisStreamClient holds the producers built from the config and exposes them via the `client.<name>.producer.<p>` / `client.<name>.producers` addressing, mirroring the redis_pubsub publisher shape.

func (*RedisStreamClient) CtyValue

func (c *RedisStreamClient) CtyValue() cty.Value

func (*RedisStreamClient) OnEvent

func (c *RedisStreamClient) OnEvent(ctx context.Context, topic string, msg any, fields map[string]string) error

OnEvent fans out to every producer.

func (*RedisStreamClient) Start

func (c *RedisStreamClient) Start() error

Start brings up every configured consumer.

func (*RedisStreamClient) Stop

func (c *RedisStreamClient) Stop() error

type RedisStreamDefinition

type RedisStreamDefinition struct {
	Connection hcl.Expression `hcl:"connection"`
	WireFormat hcl.Expression `hcl:"wire_format,optional"`
	Metrics    hcl.Expression `hcl:"metrics,optional"`
	Tracing    hcl.Expression `hcl:"tracing,optional"`
	Producers  []ProducerDef  `hcl:"producer,block"`
	Consumers  []ConsumerDef  `hcl:"consumer,block"`
	DefRange   hcl.Range      `hcl:",def_range"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL