app

package
v0.0.0-...-08d8c9a Latest Latest
Warning

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

Go to latest
Published: May 1, 2020 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Start

func Start(ctx context.Context, config *Config) error

Types

type Config

type Config struct {
	ListenAddress  net.TCPAddr // Network address and port where the application should listen on
	AllowedOrigins string      // CORS policy allowed origins
	PostgresURL    string      // URL for connecting to Postgres service
}

func (*Config) Validate

func (c *Config) Validate() error

Validate checks configuration for stupid values

type Middleware

type Middleware func(http.Handler) http.Handler

Middleware ...

type Stack

type Stack interface {
	// Adds a middleware to the stack. MWs will be called in the same order that they are added, such that:
	//	Use(Request ID Middleware)
	//  Use(Request Timing Middleware)
	// would result in the request id middleware being the outermost layer, called first, before the timing middleware.
	Use(Middleware)

	// Wraps a given handle with the current stack from the result of Use() calls.
	Wrap(http.Handler) http.Handler
}

Stack ...

Jump to

Keyboard shortcuts

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