proxy

package
v0.0.0-...-14e119e Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2021 License: BSD-3-Clause Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateNativeQueries

func GenerateNativeQueries(proto string, tslQuery string, defaultToken string, allowAuthenticate bool) (string, error)

GenerateNativeQueries Generate a TSL query in its native proto format allowAuthenticate works only for a Warp 10 backend (force a Token authenticate to raise native limits)

func GenerateNativeQueriesWithParams

func GenerateNativeQueriesWithParams(proto string, tslQuery string, defaultToken string, allowAuthenticate bool, params map[string]string) (string, error)

GenerateNativeQueriesWithParams Generate a TSL query in its native proto format with a param map replacing query headers allowAuthenticate works only for a Warp 10 backend (force a Token authenticate to raise native limits)

func GetTokenFromBasicAuth

func GetTokenFromBasicAuth(request *http.Request) string

GetTokenFromBasicAuth is fetching the token for an HTTP Request

Types

type PromData

type PromData struct {
	ResultType string `json:"resultType,omitempty"`
	Result     string `json:"result,omitempty"`
}

PromData Internal prom error data, loaded internally only on error

type PromError

type PromError struct {
	Status    string   `json:"status,omitempty"`
	Data      PromData `json:"data,omitempty"`
	ErrorType string   `json:"errorType,omitempty"`
	Error     string   `json:"error,omitempty"`
}

PromError Internal prom error message, loaded internally only on error

type ProxyTSL

type ProxyTSL struct {
	ReqCounter  prometheus.Counter
	ErrCounter  prometheus.Counter
	WarnCounter prometheus.Counter
}

Tsl struct

func NewProxyTSL

func NewProxyTSL(promRegistry *prometheus.Registry) *ProxyTSL

NewProxyTSL is creating a new tsl proxy query handler

func (ProxyTSL) Query

func (proxyTsl ProxyTSL) Query(ctx echo.Context) error

Query is the main API call method to start parsing Tsl queries

type Request

type Request struct {
	API   string `json:"api,omitempty"`
	Token string `json:"token,omitempty"`
	Body  string `json:"body,omitempty"`
}

Request main syntax

Jump to

Keyboard shortcuts

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