kafka

package
v2.7.3 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package kafka implements a kafka proxy for HTTP requests.

Index

Constants

View Source
const (
	// Kind is the kind of Kafka
	Kind = "Kafka"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Dynamic

type Dynamic struct {
	Header string `json:"header,omitempty"`
}

Dynamic defines dynamic ways to get Kafka topic from http request

type Err added in v2.7.3

type Err struct {
	Err  string `json:"err"`
	Code int    `json:"code"`
}

Err is the error of Kafka

type Kafka

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

Kafka is a kafka proxy for HTTP requests.

func (*Kafka) Close

func (k *Kafka) Close()

Close close Kafka

func (*Kafka) Handle

func (k *Kafka) Handle(ctx *context.Context) (result string)

Handle handles the context.

func (*Kafka) Inherit

func (k *Kafka) Inherit(previousGeneration filters.Filter)

Inherit init Kafka based on previous generation

func (*Kafka) Init

func (k *Kafka) Init()

Init init Kafka

func (*Kafka) Kind

func (k *Kafka) Kind() *filters.Kind

Kind return kind of Kafka

func (*Kafka) Name

func (k *Kafka) Name() string

Name returns the name of the Kafka filter instance.

func (*Kafka) Spec

func (k *Kafka) Spec() filters.Spec

Spec returns the spec used by the Kafka

func (*Kafka) Status

func (k *Kafka) Status() interface{}

Status return status of Kafka

type Key added in v2.7.3

type Key struct {
	Default string   `json:"default"`
	Dynamic *Dynamic `json:"dynamic,omitempty"`
}

Key defined ways to get Kafka key

type Spec

type Spec struct {
	filters.BaseSpec `json:",inline"`

	Backend []string `json:"backend" jsonschema:"required,uniqueItems=true"`
	Sync    bool     `json:"sync,omitempty"`

	Topic *Topic `json:"topic" jsonschema:"required"`
	Key   Key    `json:"key,omitempty"`
}

Spec is spec of Kafka

type Topic

type Topic struct {
	Default string   `json:"default" jsonschema:"required"`
	Dynamic *Dynamic `json:"dynamic,omitempty"`
}

Topic defined ways to get Kafka topic

Jump to

Keyboard shortcuts

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