Help us shape the future of Go! Take the 2026 Go Developer Survey

server

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigAdd

func ConfigAdd(path string)

func NewServer

func NewServer(handler http.Handler) *http.Server

NewServer returns a pointer with new http Server

func NewServerWithConfigPath

func NewServerWithConfigPath(handler http.Handler, path string) (*http.Server, error)

NewServerWithConfigPath returns a pointer with new http Server

func NewServerWithOptions

func NewServerWithOptions(handler http.Handler, options *Options) *http.Server

NewServerWithOptions returns a pointer with new http Server

Types

type Options

type Options struct {
	Addr              string
	MaxHeaderBytes    int
	ReadHeaderTimeout time.Duration
	ReadTimeout       time.Duration
	WriteTimeout      time.Duration
	IdleTimeout       time.Duration
}

Options http server options.

func NewOptions

func NewOptions() (*Options, error)

NewOptions returns options from config file or environment vars.

func NewOptionsWithPath

func NewOptionsWithPath(path string) (opts *Options, err error)

NewOptionsWithPath unmarshals options based a given key path.

Jump to

Keyboard shortcuts

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