parser

package
v0.0.0-...-6ee8545 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultParser

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

DefaultParser is in charge of parsing the incoming request based on the format and running the preprocessors on the format.

func NewParser

func NewParser() *DefaultParser

NewParser returns a parser with the correct mapping of format and format parser.

func (*DefaultParser) AddPreprocessor

func (p *DefaultParser) AddPreprocessor(pre Preprocessor)

AddPreprocessor adds a Preprocessor to the array of preprocessors.

func (DefaultParser) ParseRequest

func (d DefaultParser) ParseRequest(r *http.Request, req *prompb.WriteRequest) error

ParseRequest runs the correct parser on the format of the request and runs the preprocessors on the payload afterwards.

type Preprocessor

type Preprocessor interface {
	Process(*http.Request, *prompb.WriteRequest) error
}

Preprocessor is used to transform the incoming write request before sending it for ingestion.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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