server

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2025 License: GPL-3.0 Imports: 3 Imported by: 0

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

func Start(port int, logger zerolog.Logger) error

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.

Jump to

Keyboard shortcuts

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