Documentation
¶
Overview ¶
Package server provides HTTP server functionality for the k8s-controller application. It implements a FastHTTP-based server with health check endpoints and structured logging.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Start ¶
Start starts the HTTP server on the specified port. It creates a FastHTTP server with the application's handler and begins listening for incoming requests. The function blocks until the server encounters an error.
Parameters:
- port: The TCP port number to bind the server to
- logger: A zerolog.Logger instance for structured logging
Returns an error if the server fails to start or encounters a runtime error.
Example ¶
ExampleStart demonstrates how to start the HTTP server. This example shows the basic usage of the Start function with a logger and port configuration.
// This example shows how to start the server
// Note: In real usage, this would block until the server stops
// Start server on port 8080
// err := Start(8080, logger)
// if err != nil {
// log.Fatal(err)
// }
fmt.Println("Server would start on :8080")
Output: Server would start on :8080
Types ¶
This section is empty.