rest

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2021 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Overview

Package rest contains the support code for the plain HTTP API.

Index

Constants

This section is empty.

Variables

Set is used by wire.

Functions

This section is empty.

Types

type CLIConfigHandler

type CLIConfigHandler http.Handler

CLIConfigHandler allows a user to download a ready-to-run CLI configuration file.

func ProvideCLIConfigHandler

func ProvideCLIConfigHandler(
	cfg *common.Config,
	latchWrapper LatchWrapper,
	pprofWrapper PProfWrapper,
	sessionWrapper SessionWrapper,
	vhostWrapper VHostWrapper,
) CLIConfigHandler

ProvideCLIConfigHandler is called by wire.

type DebugMux

type DebugMux struct {
	*http.ServeMux
}

DebugMux has additional debugging endpoints attached.

func ProvideDebugMux

func ProvideDebugMux(
	metrics metrics.Handler,
	healthz Healthz,
) DebugMux

ProvideDebugMux is called by wire.

type FileHandler

type FileHandler http.Handler

FileHandler implements a traditional web-server.

func ProvideFileHandler

func ProvideFileHandler(
	blobs *blob.Store,
	enforcer *enforcer.Enforcer,
	f *fs.Store,
	logger *log.Logger,
	pprofWrapper PProfWrapper,
	latchWrapper LatchWrapper,
	sessionWrapper SessionWrapper,
	vHostWrapper VHostWrapper,
) FileHandler

ProvideFileHandler is called by wire.

type Healthz

type Healthz http.Handler

Healthz verifies database connectivity.

func ProvideHealthz

func ProvideHealthz(db *pgxpool.Pool, logger *log.Logger) Healthz

ProvideHealthz is called by wire.

type LatchWrapper

type LatchWrapper Wrapper

LatchWrapper holds and releases a latch when its enclosed handler is active.

func ProvideLatchWrapper

func ProvideLatchWrapper(latch common.BusyLatch) LatchWrapper

ProvideLatchWrapper is called by wire.

type PProfWrapper

type PProfWrapper Wrapper

PProfWrapper decorates the goroutines with additional pprof labels.

func ProvidePProfWrapper

func ProvidePProfWrapper() PProfWrapper

ProvidePProfWrapper is called by wire.

type Provision

type Provision http.Handler

Provision hosts a trivial landing page to trigger OIDC login.

func ProvideProvision

func ProvideProvision(
	cfg *common.Config,
	connector *oidc.Connector,
	logger *log.Logger,
	principals principal.PrincipalsServer,
	pprofWrapper PProfWrapper,
	latchWrapper LatchWrapper,
	sessionWrapper SessionWrapper,
	vHostWrapper VHostWrapper,
) (Provision, error)

ProvideProvision is called by wire.

type PublicMux

type PublicMux struct {
	*http.ServeMux
}

PublicMux has public functionality attached.

func ProvidePublicMux

func ProvidePublicMux(
	cliConfig CLIConfigHandler,
	connector *oidc.Connector,
	fileHandler FileHandler,
	measure metrics.Wrapper,
	provision Provision,
	retrieve Retrieve,
	rpc *grpc.Server,
) PublicMux

ProvidePublicMux is called by wire.

type Retrieve

type Retrieve http.Handler

Retrieve implements the signed-URL endpoint.

func ProvideRetrieve

func ProvideRetrieve(
	logger *log.Logger,
	fs *fs.Store,
	pprofWrapper PProfWrapper,
	latchWrapper LatchWrapper,
	sessionWrapper SessionWrapper,
	vHostWrapper VHostWrapper,
) Retrieve

ProvideRetrieve is called by wire.

type SessionWrapper

type SessionWrapper Wrapper

SessionWrapper will extract a validated session token from the incoming request or attach a "public" session.

func ProvideSessionWrapper

func ProvideSessionWrapper(
	bootstrap *bootstrap.Bootstrapper,
	connector *oidc.Connector,
	tokens token.TokensServer,
) SessionWrapper

ProvideSessionWrapper is called by wire.

type VHostWrapper

type VHostWrapper Wrapper

VHostWrapper will inject a VHost reference into the context.

func ProvideVHostWrapper

func ProvideVHostWrapper(
	logger *log.Logger,
	mapper *common.VHostMap,
) VHostWrapper

ProvideVHostWrapper is called by wire.

type Wrapper

type Wrapper func(http.Handler) http.Handler

A Wrapper alters the behavior of an http.Handler.

Jump to

Keyboard shortcuts

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