gateway

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2020 License: AGPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Gateway

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

Gateway is the main struct

func NewGateway

func NewGateway(options *Options) *Gateway

NewGateway creates a Vulcain gateway instance

func NewGatewayFromEnv

func NewGatewayFromEnv() (*Gateway, error)

NewGatewayFromEnv creates a gateway using the configuration set in env vars

func (*Gateway) Serve

func (g *Gateway) Serve()

Serve starts the HTTP server

func (*Gateway) ServeHTTP

func (g *Gateway) ServeHTTP(rw http.ResponseWriter, req *http.Request)

type Options

type Options struct {
	Debug        bool
	Addr         string
	Upstream     *url.URL
	MaxPushes    int
	AcmeHosts    []string
	AcmeCertDir  string
	CertFile     string
	KeyFile      string
	ReadTimeout  time.Duration
	WriteTimeout time.Duration
	Compress     bool
	OpenAPIFile  string
}

Options stores the gateway's Options

func NewOptionsFromEnv

func NewOptionsFromEnv() (*Options, error)

NewOptionsFromEnv creates a new option instance from environment It returns an error if mandatory env env vars are missing

type Type

type Type int

Type is the type of operation to apply, can be Preload or Fields

const (
	// Preload is a preloading action through query parameters or headers
	Preload Type = iota
	// Fields is a filtering action through query parameters or headers
	Fields
)

Jump to

Keyboard shortcuts

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