config

package
v0.0.0-...-ddd20ef Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2019 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllowCors

func AllowCors(cfg *ProxyConfig, handler http.Handler) http.Handler

func LogFormatter

func LogFormatter(cfg *ProxyConfig) handlers.LogFormatter

func SetupGateway

func SetupGateway() *runtime.ServeMux

func SetupViper

func SetupViper(envPrefix string) *viper.Viper

SetupViper returns a viper configuration object

Types

type ProxyConfig

type ProxyConfig struct {
	// The JWT signing key to validate Bearer tokens
	JWTKey string
	// The Backend gRPC service to listen to.
	Endpoint string
	// The log level to use
	LogLevel string
	// Whether to log request headers
	LogHeaders bool
	// Value to set for Access-Control-Allow-Origin header.
	CorsAllowOrigin string
	// Value to set for Access-Control-Allow-Credentials header.
	CorsAllowCredentials string
	// Value to set for Access-Control-Allow-Methods header.
	CorsAllowMethods string
	// Value to set for Access-Control-Allow-Headers header.
	CorsAllowHeaders string
	// Prefix that this gateway is running on. For example, if your API endpoint
	// was "/foo/bar" in your protofile, and you wanted to run APIs under "/api",
	// set this to "/api/".
	ApiPrefix string
}

Jump to

Keyboard shortcuts

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