server

package
v0.15.14 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2024 License: AGPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithRequestIDMiddleware

func WithRequestIDMiddleware(m func(next http.Handler) http.Handler) func(*Server)

WithRequestIDMiddleware overrides the middleware which provides request IDs. It's used for running the Server in production, where request IDs come from the AWS Lambda context rather than being generated internally by Chi.

Types

type API

type API interface {
	Handler(r chi.Router) http.Handler
}

APIs can provider HTTP Handlers

type Config

type Config struct {
	Config        config.Config
	Log           *zap.SugaredLogger
	Authenticator auth.Authenticator
	// IdentitySyncer is piped through to the auth middleware,
	// so that we can sync the IDP if we get an authenticated user
	// which doesn't yet exist in our database.
	IdentitySyncer auth.IdentitySyncer
	API            API
}

type Server

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

func New

func New(ctx context.Context, cfg Config, opts ...func(*Server)) (*Server, error)

func (*Server) Handler

func (c *Server) Handler() http.Handler

func (*Server) Start

func (s *Server) Start(ctx context.Context) error

Jump to

Keyboard shortcuts

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