server

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2025 License: MIT Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

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

func NewServer

func NewServer(serverConfig *ServerConfig) *Server

func (*Server) Start

func (s *Server) Start() error

func (*Server) Stop

func (s *Server) Stop()

type ServerConfig

type ServerConfig struct {
	CorsConfig *cors.Options
	// MuxCallback registers endpoints and custom middlewares to the HTTP mux.
	MuxCallback func(*http.ServeMux)
	// MiddlewareCallback customizes the Negroni middleware stack before the server starts.
	MiddlewareCallback func(*negroni.Negroni) *negroni.Negroni
	// ListenCallback is called after the server starts listening, before serving requests.
	ListenCallback func()
	// PortOverride manually sets the port. If empty, uses the PORT environment variable.
	PortOverride string
}

ServerConfig configures the API server's endpoints, middleware, and startup behavior.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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