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.