raw

package
v2.40.6 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: Apache-2.0 Imports: 16 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Endpoint             string        `mapstructure:"address"`          // Endpoint of the nats server
	Cluster              string        `mapstructure:"clusterID"`        // CluserID of the nats cluster
	TLSInsecure          bool          `mapstructure:"tls-insecure"`     // Whether to verify TLS certificates
	TLSRootCACertificate string        `mapstructure:"tls-root-ca-cert"` // The root CA certificate used to validate the TLS certificate
	EnableTLS            bool          `mapstructure:"enable-tls"`       // Enable TLS
	AuthUsername         string        `mapstructure:"username"`         // Username for authentication
	AuthPassword         string        `mapstructure:"password"`         // Password for authentication
	MaxAckPending        int           `mapstructure:"max-ack-pending"`  // Maximum number of unacknowledged messages
	AckWait              time.Duration `mapstructure:"ack-wait"`         // Time to wait for an ack
}

Config is the configuration needed for a NATS event stream

type Event

type Event struct {
	events.Event
	// contains filtered or unexported fields
}

func (*Event) Ack

func (re *Event) Ack() error

func (*Event) InProgress

func (re *Event) InProgress() error

type RawEvent

type RawEvent struct {
	Timestamp time.Time
	Metadata  map[string]string
	ID        string
	Topic     string
	Payload   []byte
	// contains filtered or unexported fields
}

type RawStream

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

func (*RawStream) Consume

func (s *RawStream) Consume(group string, evs ...events.Unmarshaller) (<-chan Event, error)

func (*RawStream) JetStream

func (s *RawStream) JetStream() jetstream.Stream

type Stream

type Stream interface {
	Consume(group string, evs ...events.Unmarshaller) (<-chan Event, error)
	JetStream() jetstream.Stream
}

func FromConfig

func FromConfig(ctx context.Context, name string, cfg Config) (Stream, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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