server

package
v0.0.0-...-c0de8fe Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHTTPHandler

func NewHTTPHandler(api *rest.APISurface) http.Handler

NewHTTPHandler creates a new Router and registers API handlers

Types

type Server

type Server struct {
	// Router is a mux.Router that registers the handlers for the HTTP
	// operations:
	//
	// - OSB API
	// - metrics API
	Router *mux.Router
}

Server is the server for the OSB REST API and the metrics API. A Server glues the HTTP operations to their implementations.

func New

func New(api *rest.APISurface, reg prom.Gatherer) *Server

New creates a new Router and registers all the necessary endpoints and handlers.

func (*Server) Run

func (s *Server) Run(ctx context.Context, addr string) error

Run creates the HTTP handler and begins to listen on the specified address.

func (*Server) RunTLS

func (s *Server) RunTLS(ctx context.Context, addr string, cert string, key string) error

RunTLS creates the HTTPS handler based on the certifications that were passed and begins to listen on the specified address.

func (*Server) RunTLSWithTLSFiles

func (s *Server) RunTLSWithTLSFiles(ctx context.Context, addr string, certFilePath string, keyFilePath string) error

RunTLSWithTLSFiles creates the HTTPS handler based on the certification files that were passed and begins to listen on the specified address.

Jump to

Keyboard shortcuts

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