api

package
v0.0.0-...-39c03fc Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2024 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	URLParamSnapshotID   = "snapshotID"
	URLParamTracepointID = "tpID"

	HeaderAccept         = "Accept"
	HeaderContentType    = "Content-Type"
	HeaderAcceptProtobuf = "application/protobuf"
	HeaderAcceptJSON     = "application/json"

	PathPrefixQuerier = "/querier"

	PathSnapshots       = "/api/snapshots/{snapshotID}"
	PathSearch          = "/api/search"
	PathSearchTags      = "/api/search/tags"
	PathSearchTagValues = "/api/search/tag/{tagName}/values"
	PathEcho            = "/api/echo"
	PathUsageStats      = "/status/usage-stats"

	PathPrefixTracepoints = "/tracepoints"

	PathTracepoints      = "/api/tracepoints"
	PathTracepointsQuery = "/api/tracepoints/query"
	PathDeleteTracepoint = "/api/tracepoints/{tpID}"

	PathSearchTagValuesV2 = "/api/v2/search/tag/{tagName}/values"

	QueryModeKey       = "mode"
	QueryModeIngesters = "ingesters"
	QueryModeBlocks    = "blocks"
	QueryModeAll       = "all"
	BlockStartKey      = "blockStart"
	BlockEndKey        = "blockEnd"
)

Variables

This section is empty.

Functions

func AddServerlessParams

func AddServerlessParams(req *http.Request, maxBytes int) *http.Request

AddServerlessParams takes an already existing http.Request and adds maxBytes to it

func BuildIngesterSearchRequest

func BuildIngesterSearchRequest(req *http.Request, searchReq *deeppb.SearchRequest, start, end uint32) (*http.Request, error)

BuildIngesterSearchRequest takes a deeppb.SearchRequest and creates a request for searching the ingesters

func BuildSearchBlockRequest

func BuildSearchBlockRequest(req *http.Request, searchReq *deeppb.SearchBlockRequest) (*http.Request, error)

BuildSearchBlockRequest takes a deeppb.SearchBlockRequest and populates the passed http.Request with the appropriate params. If no http.Request is provided a new one is created.

func BuildSearchRequest

func BuildSearchRequest(req *http.Request, searchReq *deeppb.SearchRequest) (*http.Request, error)

BuildSearchRequest takes a deeppb.SearchRequest and populates the passed http.Request with the appropriate params. If no http.Request is provided a new one is created.

func ExtractServerlessParams

func ExtractServerlessParams(req *http.Request) (int, error)

ExtractServerlessParams extracts params for the serverless functions from an http.Request

func IsBackendSearch

func IsBackendSearch(r *http.Request) bool

IsBackendSearch returns true if the request has a start, end and tags parameter and is the /api/search path

func IsDeepQLQuery

func IsDeepQLQuery(r *deeppb.SearchRequest) bool

IsDeepQLQuery returns true if the request contains a deepQL query.

func IsDeepQLReq

func IsDeepQLReq(r *http.Request) (bool, string)

IsDeepQLReq returns true if the request contains a deepQL query.

func IsSearchBlock

func IsSearchBlock(r *http.Request) bool

IsSearchBlock returns true if the request appears to be for backend blocks. It is not exhaustive and only looks for blockID

func ParseMessageToHttp

func ParseMessageToHttp(w http.ResponseWriter, r *http.Request, span opentracing.Span, data proto.Message)

func ParseSearchBlockRequest

func ParseSearchBlockRequest(r *http.Request) (*deeppb.SearchBlockRequest, error)

ParseSearchBlockRequest parses all http parameters necessary to perform a block search.

func ParseSearchRequest

func ParseSearchRequest(r *http.Request) (*deeppb.SearchRequest, error)

ParseSearchRequest takes an http.Request and decodes query params to create a deeppb.SearchRequest

func ParseSnapshotID

func ParseSnapshotID(r *http.Request) ([]byte, error)

func ValidateAndSanitizeRequest

func ValidateAndSanitizeRequest(r *http.Request) (string, string, string, int64, int64, error)

ValidateAndSanitizeRequest validates params for snapshot by id api return values are (blockStart, blockEnd, queryMode, start, end, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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