adapter

package
v0.0.0-...-1a88b7f Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KafkaAdapter

type KafkaAdapter struct{}

KafkaAdapter represent a specific implementation from the KafkaHeaders adapter interface.

func (KafkaAdapter) FromEchoContext

func (a KafkaAdapter) FromEchoContext(ctx echo.Context, event string) (headers []kafka.Header, err error)

FromEchoContext translate from an echo.Context to []kafka.Header ctx is the echo.Context from an http handler. event is an additional type to identify exactly the schema which match with the kafka message. Return headers a slice of kafka.Header and nil error when success, else an error reference filled and an empty slice of kafka.Header.

type KafkaHeaders

type KafkaHeaders interface {
	FromEchoContext(ctx echo.Context, event string) (headers []kafka.Header, err error)
}

KafkaHeaders is the adapter interface to translate to kafka.Header slice which is used to compose a kafka message.

func NewKafkaHeaders

func NewKafkaHeaders() KafkaHeaders

NewKafkaHeaders create KafkaAdapter and return the KafkaHeaders interface. Return KafkaHeaders interface.

Jump to

Keyboard shortcuts

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