server

package
v0.0.0-...-0490640 Latest Latest
Warning

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

Go to latest
Published: May 16, 2019 License: Apache-2.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 BldrClient

type BldrClient struct {
	SignInURL    *url.URL
	ClientID     string
	ClientSecret string
}

BldrClient holds the config for the bldr oauth2 client.

type Server

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

Server holds the server state

func New

func New(
	l logger.Logger,
	migrationConfig *migration.Config,
	oidcCfg oidc.Config,
	bldrClient *BldrClient,
	signInURL *url.URL,
	serviceCerts *certs.ServiceCerts) (*Server, error)

New returns a new instance of the server

func NewInMemory

func NewInMemory(
	l logger.Logger,
	remainingDuration time.Duration,
	oidcCfg oidc.Config,
	signInURL *url.URL,
	bldrClient *BldrClient,
	serviceCerts *certs.ServiceCerts) (*Server, error)

NewInMemory instantiates a memory-backed instance of the server, to be used for testing.

func (*Server) ListenAndServe

func (s *Server) ListenAndServe(addr string) error

ListenAndServe starts a listener, and serves requests using Server's embedded http.ServeMux. Only ever returns with non-nil error.

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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