sink

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConsoleOutput

type ConsoleOutput struct {
	// contains filtered or unexported fields
}

ConsoleOutput implements the Output interface for printing events to stdout.

func NewConsoleOutput

func NewConsoleOutput() *ConsoleOutput

func (*ConsoleOutput) Close

func (c *ConsoleOutput) Close() error

func (*ConsoleOutput) Name

func (c *ConsoleOutput) Name() string

func (*ConsoleOutput) Send

func (c *ConsoleOutput) Send(ctx context.Context, logs []DecodedLog) error

type DecodedLog

type DecodedLog struct {
	Log         types.Log           `json:"log"`
	DecodedData *decoder.DecodedLog `json:"decoded,omitempty"`
	EventName   string              `json:"event_name,omitempty"`
}

DecodedLog wraps raw log and its decoded result for structured output.

type FileOutput

type FileOutput struct {
	// contains filtered or unexported fields
}

FileOutput implements the Output interface for writing events to a file.

func NewFileOutput

func NewFileOutput(path string) (*FileOutput, error)

NewFileOutput initializes a new file-based output sink.

func (*FileOutput) Close

func (f *FileOutput) Close() error

func (*FileOutput) Name

func (f *FileOutput) Name() string

func (*FileOutput) Send

func (f *FileOutput) Send(ctx context.Context, logs []DecodedLog) error

type KafkaOutput

type KafkaOutput struct {
	// contains filtered or unexported fields
}

KafkaOutput implements the Output interface for sending events to Kafka.

func NewKafkaOutput

func NewKafkaOutput(brokers []string, topic, user, password string) (*KafkaOutput, error)

NewKafkaOutput initializes a new Kafka output sink.

func (*KafkaOutput) Close

func (k *KafkaOutput) Close() error

func (*KafkaOutput) Name

func (k *KafkaOutput) Name() string

func (*KafkaOutput) Send

func (k *KafkaOutput) Send(ctx context.Context, logs []DecodedLog) error

type Output

type Output interface {
	Name() string
	Send(ctx context.Context, logs []DecodedLog) error
	Close() error
}

Output defines the interface for event output pipeline

type PostgresOutput

type PostgresOutput struct {
	// contains filtered or unexported fields
}

PostgresOutput implements the Output interface for saving events to PostgreSQL.

func NewPostgresOutput

func NewPostgresOutput(url, table string) (*PostgresOutput, error)

NewPostgresOutput initializes a new PostgreSQL output sink.

func (*PostgresOutput) Close

func (p *PostgresOutput) Close() error

func (*PostgresOutput) Name

func (p *PostgresOutput) Name() string

func (*PostgresOutput) Send

func (p *PostgresOutput) Send(ctx context.Context, logs []DecodedLog) error

type RabbitMQOutput

type RabbitMQOutput struct {
	// contains filtered or unexported fields
}

RabbitMQOutput implements the Output interface for sending events to RabbitMQ.

func NewRabbitMQOutput

func NewRabbitMQOutput(url, exchange, routingKey, queueName string, durable bool) (*RabbitMQOutput, error)

NewRabbitMQOutput initializes a new RabbitMQ output sink.

func (*RabbitMQOutput) Close

func (r *RabbitMQOutput) Close() error

func (*RabbitMQOutput) Name

func (r *RabbitMQOutput) Name() string

func (*RabbitMQOutput) Send

func (r *RabbitMQOutput) Send(ctx context.Context, logs []DecodedLog) error

type RedisOutput

type RedisOutput struct {
	// contains filtered or unexported fields
}

RedisOutput implements the Output interface for sending events to Redis.

func NewRedisOutput

func NewRedisOutput(addr, password string, db int, key, mode string) (*RedisOutput, error)

NewRedisOutput initializes a new Redis output sink.

func (*RedisOutput) Close

func (r *RedisOutput) Close() error

func (*RedisOutput) Name

func (r *RedisOutput) Name() string

func (*RedisOutput) Send

func (r *RedisOutput) Send(ctx context.Context, logs []DecodedLog) error

type WebhookConfig

type WebhookConfig struct {
	URL            string
	Secret         string
	MaxAttempts    int
	InitialBackoff string
	MaxBackoff     string
	Async          bool
	BufferSize     int
	Workers        int
}

WebhookConfig holds the configuration for WebhookOutput.

type WebhookOutput

type WebhookOutput struct {
	// contains filtered or unexported fields
}

WebhookOutput implements the Output interface for sending events to a web service.

func NewWebhookOutput

func NewWebhookOutput(url, secret string, maxAttempts int, initialBackoff, maxBackoff string, async bool, bufferSize, workers int) *WebhookOutput

NewWebhookOutput initializes a new Webhook output sink.

func (*WebhookOutput) Close

func (w *WebhookOutput) Close() error

func (*WebhookOutput) Name

func (w *WebhookOutput) Name() string

func (*WebhookOutput) Send

func (w *WebhookOutput) Send(ctx context.Context, logs []DecodedLog) error

Jump to

Keyboard shortcuts

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