proxy

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GlobalDatasourceProxyPath

func GlobalDatasourceProxyPath(datasource, subPath string) string

GlobalDatasourceProxyPath builds the Perses proxy sub-path for a global datasource. subPath is the datasource-relative endpoint path (e.g. /api/v1/query_range).

func NormalizeMethod

func NormalizeMethod(method string) string

func NormalizePath

func NormalizePath(path string) string

func ProjectDatasourceProxyPath

func ProjectDatasourceProxyPath(project, datasource, subPath string) string

ProjectDatasourceProxyPath builds the Perses proxy sub-path for a project-scoped datasource. subPath is the datasource-relative endpoint path (e.g. /api/v1/query_range).

Types

type Helper

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

func New

func New(client apiClient.ClientInterface) *Helper

func (*Helper) Do

func (h *Helper) Do(ctx context.Context, input ProxyQuery) (*QueryResult, error)

type ProxyQuery

type ProxyQuery struct {
	Method      string
	Path        string
	QueryParams map[string]string
	Body        string
	Headers     map[string]string
}

type QueryResult

type QueryResult struct {
	StatusCode int               `json:"status_code"`
	Headers    map[string]string `json:"headers,omitempty"`
	Body       string            `json:"body,omitempty"`
}

Jump to

Keyboard shortcuts

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