gateway

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package gateway implements an HTTP server that forwards JSON requests to an upstream SpiceDB gRPC server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHTTPServer

func NewHTTPServer(ctx context.Context, cfg Config) (*http.Server, error)

NewHTTPServer initializes a new HTTP server with the provided configuration.

func OtelAnnotator

func OtelAnnotator(ctx context.Context, r *http.Request) metadata.MD

OtelAnnotator propagates the OpenTelemetry tracing context to the outgoing gRPC metadata.

Types

type Config

type Config struct {
	// Addr is the address on which the HTTP server will be configured to listen.
	Addr string

	// UpstreamAddr is the address of the gRPC server to which requests will be
	// forwarded.
	UpstreamAddr string

	// UpstreamTLSDisabled toggles whether or not the upstream connection will be
	// secure.
	UpstreamTLSDisabled bool

	// UpstreamTLSCertPath is the filesystem location of the certificate used to
	// secure the upstream connection.
	UpstreamTLSCertPath string
}

Config represents the require configuration for initializing a REST gateway.

Jump to

Keyboard shortcuts

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