Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var HeadersExcluded = getHeaderListFromEnv("KAFKA_RAW_HEADERS_HTTP_EXCLUDED", "Cookie")
HeadersExcluded contains a map with the HTTP headers that should not be stored or processed. It is extracted from the environment variable KAFKA_RAW_HTTP_EXCLUDED_HEADERS and by default excludes the 'Cookie' header
var HeadersIPForwarding = getHeaderListFromEnv("KAFKA_RAW_HTTP_HEADERS_IP_FORWARDING", "X-Forwarded-For,X-Real-Ip")
HeadersIPForwarding contains a map with the HTTP headers that should be considered for IP forwarding. It is extracted from the environment variable KAFKA_RAW_HTTP_HEADERS_IP_FORWARDING and by default considers the headers X-Forwarded-For and X-Real-Ip in this order
var SchemaDefaultLocation = "./request.avsc"
SchemaDefaultLocation contains the default path to the request schema
Functions ¶
Types ¶
type KafkaCodec ¶
KafkaCodec represents an Avro codec to encode the raw HTTP messages info
func LoadKafkaCodec ¶
func LoadKafkaCodec(schemaPath string) (*KafkaCodec, error)
LoadKafkaCodec loads a new codec from the schema path
func (*KafkaCodec) Register ¶
func (codec *KafkaCodec) Register(endpoint, topic string) error
Register registers this Kafka codec to the Schema Registry
func (*KafkaCodec) Restify ¶
func (codec *KafkaCodec) Restify(req *RequestInfo) ([]byte, error)
Restify encodes the data of the raw request into a Kafka-REST compatible format
type RequestInfo ¶
type RequestInfo struct { Headers http.Header `json:"headers"` IP string `json:"ip" faker:"ipv4"` Method string `json:"method"` ServerTime time.Time `json:"server_time"` URL string `json:"url" faker:"url"` Body []byte `json:"body"` ParseErrors []string }
RequestInfo contains the information for a raw HTTP request
func (*RequestInfo) Parse ¶
func (reqInfo *RequestInfo) Parse(req *http.Request)
Parse fills up the raw request struct with info parsed from the HTTP request