server

package
v0.2.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func API

func API(cfg *APIConfig) http.Handler

API constructs an http.Handler with all application routes defined.

Types

type APIConfig

type APIConfig struct {
	Shutdown   chan os.Signal
	Log        *zap.SugaredLogger
	Tracer     trace.Tracer
	TokenStore tokens.TokenStorer
	Demo       bool
}

APIConfig is the configuration struct to build the API handlers

type App

type App struct {
	*chi.Mux
	// contains filtered or unexported fields
}

App is the entrypoint into our application and what configures our TODO: context object for each of our http handlers.

func NewApp

func NewApp(shutdown chan os.Signal, log *zap.SugaredLogger) *App

NewApp creates an App value that handle a set of routes for the application.

func (*App) ServeHTTP

func (a *App) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*App) SignalShutdown

func (a *App) SignalShutdown()

SignalShutdown is used to gracefully shutdown the app when an integrity issue is identified.

Jump to

Keyboard shortcuts

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