server

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package server provides HTTP server functionality for workers and coordinators.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, handler any, cfg Config) error

Run starts an HTTP server for a worker or coordinator.

Types

type Config

type Config struct {
	// Port is the port to listen on.
	Port int

	// ReadTimeout is the maximum duration for reading the request.
	ReadTimeout time.Duration

	// WriteTimeout is the maximum duration for writing the response.
	WriteTimeout time.Duration

	// IdleTimeout is the maximum duration to wait for the next request.
	IdleTimeout time.Duration

	// Logger is the logger for the server.
	Logger *slog.Logger
}

Config configures the HTTP server.

func (*Config) Defaults

func (c *Config) Defaults()

Defaults applies default values to the config.

Jump to

Keyboard shortcuts

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