server

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleError

func HandleError(w http.ResponseWriter, r *http.Request, err error)

HandleError central handler for all errors

func MetricsHandler

func MetricsHandler(w http.ResponseWriter, r *http.Request)

MetricsHandler proxies Prometheus metrics from the internal exporter so callers can scrape /metrics on the main HTTP server.

Types

type Options

type Options struct {
	JobsRoot       string
	JobsInvocation *jobregistry.IndexBuildInvocation
}

type Server

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

Server represents the HTTP server

func New

func New(host string, port int) *Server

New creates a new HTTP server instance

func NewWithOptions

func NewWithOptions(host string, port int, opts Options) *Server

NewWithOptions creates a new HTTP server instance with optional subsystems.

func (*Server) Handler

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

Handler exposes the underlying router for testing and instrumentation

func (*Server) Port

func (s *Server) Port() int

Port returns the server port for testing

func (*Server) Shutdown

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

Shutdown gracefully shuts down the HTTP server

func (*Server) Start

func (s *Server) Start() error

Start starts the HTTP server

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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