headertojson

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: 6 Imported by: 0

Documentation

Overview

Package headertojson implements a filter to convert HTTP request header to json.

Index

Constants

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

Variables

This section is empty.

Functions

This section is empty.

Types

type HeaderMap

type HeaderMap struct {
	Header string `json:"header" jsonschema:"required"`
	JSON   string `json:"json" jsonschema:"required"`
}

HeaderMap defines relationship between http header and json

type HeaderToJSON

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

HeaderToJSON put http request headers into body as JSON fields.

func (*HeaderToJSON) Close

func (h *HeaderToJSON) Close()

Close close HeaderToJSON

func (*HeaderToJSON) Handle

func (h *HeaderToJSON) Handle(ctx *context.Context) string

Handle handle Context

func (*HeaderToJSON) Inherit

func (h *HeaderToJSON) Inherit(previousGeneration filters.Filter)

Inherit init HeaderToJSON based on previous generation

func (*HeaderToJSON) Init

func (h *HeaderToJSON) Init()

Init init HeaderToJSON

func (*HeaderToJSON) Kind

func (h *HeaderToJSON) Kind() *filters.Kind

Kind return kind of HeaderToJSON

func (*HeaderToJSON) Name

func (h *HeaderToJSON) Name() string

Name returns the name of the HeaderToJSON filter instance.

func (*HeaderToJSON) Spec

func (h *HeaderToJSON) Spec() filters.Spec

Spec returns the spec used by the HeaderToJSON

func (*HeaderToJSON) Status

func (h *HeaderToJSON) Status() interface{}

Status return status of HeaderToJSON

type Spec

type Spec struct {
	filters.BaseSpec `json:",inline"`
	HeaderMap        []*HeaderMap `json:"headerMap" jsonschema:"required"`
}

Spec is spec of HeaderToJson

Jump to

Keyboard shortcuts

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