transport

package
v0.7.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// DestinationHub is the key used for destination-hub name header.
	DestinationHub = "destination-hub"
	// CompressionType is the key used for compression type header.
	CompressionType = "content-encoding"
	// Size is the key used for total bundle size header.
	Size = "size"
	// Offset is the key used for message fragment offset header.
	Offset = "offset"
	// FragmentationTimestamp is the key used for bundle fragmentation time header.
	FragmentationTimestamp = "fragmentation-timestamp"
	// Broadcast can be used as destination when a bundle should be broadcasted.
	Broadcast = ""

	// Kafka transportType and transportFormat values
	Kafka              TransportType   = "kafka"
	Chan               TransportType   = "chan"
	KafkaMessageFormat TransportFormat = "message"
	CloudEventsFormat  TransportFormat = "cloudEvents"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Consumer

type Consumer interface {
	// start the transport to consume message
	Start(ctx context.Context) error
	// provide a blocking message to get the message
	MessageChan() chan *Message
}

type KafkaConfig

type KafkaConfig struct {
	BootstrapServer string
	CaCertPath      string
	ClientCertPath  string
	ClientKeyPath   string
	EnableTLS       bool
	ProducerConfig  *KafkaProducerConfig
	ConsumerConfig  *KafkaConsumerConfig
}

Kafka Config

type KafkaConsumerConfig

type KafkaConsumerConfig struct {
	ConsumerID    string
	ConsumerTopic string
}

type KafkaProducerConfig

type KafkaProducerConfig struct {
	ProducerID         string
	ProducerTopic      string
	MessageSizeLimitKB int
}

type Message

type Message struct {
	Destination string `json:"destination"`
	Key         string `json:"key"`
	ID          string `json:"id"`
	MsgType     string `json:"msgType"`
	Version     string `json:"version"`
	Payload     []byte `json:"payload"`
}

Message abstracts a message object to be used by different transport components.

type Producer

type Producer interface {
	Send(ctx context.Context, msg *Message) error
}

type TransportConfig

type TransportConfig struct {
	TransportType          string
	TransportFormat        string
	MessageCompressionType string
	CommitterInterval      time.Duration
	KafkaConfig            *KafkaConfig
	Extends                map[string]interface{}
}

type TransportFormat

type TransportFormat string

type TransportType

type TransportType string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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