gateway

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	DistributorAddress   string
	QueryFrontendAddress string
	RulerAddress         string
	AlertManagerAddress  string

	JwtSecret     string
	ExtraHeaders  string
	TenantName    string
	TenantIDClaim string

	JwksURL             string
	JwksRefreshEnabled  bool
	JwksRefreshInterval int
	JwksRefreshTimeout  int
}

Config for a gateway

func (*Config) RegisterFlags

func (cfg *Config) RegisterFlags(f *flag.FlagSet)

RegisterFlags adds the flags required to config this package's Config struct

func (*Config) Validate

func (cfg *Config) Validate() error

Validate given config parameters. Returns nil if everything is fine

type Gateway

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

Gateway hosts a reverse proxy for each upstream cortex service we'd like to tunnel after successful authentication

func New

func New(cfg Config, svr *server.Server) (*Gateway, error)

New instantiates a new Gateway

func (*Gateway) Start

func (g *Gateway) Start()

Start initializes the Gateway and starts it

type Proxy

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

Proxy pipes the traffic between the requester (Prometheus / Grafana) and upstream service

func (*Proxy) Handler

func (p *Proxy) Handler(res http.ResponseWriter, req *http.Request)

Handler is the route handler which must be bound to the routes

Jump to

Keyboard shortcuts

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