server

package
v0.0.0-...-24d3403 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(options ...Option) *server

New returns a new server.

func NewLogger

func NewLogger() logger

NewLogger creates a new slog with a JSON handler.

func NewRouter

func NewRouter() *router

NewRouter creates a new router.

Types

type Option

type Option func(*server)

Option is a function that configures the server.

func WithOptions

func WithOptions(options Options) Option

WithOptions configures the server with the given Options.

type Options

type Options struct {
	Router       *router
	TLSConfig    TLSConfig
	Logger       logger
	Host         string
	Port         int
	ReadTimeout  time.Duration
	WriteTimeout time.Duration
	IdleTimeout  time.Duration
}

Options holds the configuration for the server.

type TLSConfig

type TLSConfig struct {
	Certificate string
	Key         string
}

TLSConfig holds the configuration for the server's TLS settings.

Jump to

Keyboard shortcuts

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