httpserver

package
v0.1.0-dev Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewServer

func NewServer(conf Config, handler http.Handler) (*http.Server, error)

func RunHTTP

func RunHTTP(ctx context.Context, conf Config, opts RunOptions) error

func RunHTTPS

func RunHTTPS(ctx context.Context, conf Config, tlsOpts TLSOptions, opts RunOptions) error

Types

type Config

type Config struct {
	Addr string

	// if non-empty, a fixed status code returned for all requests
	// when zero, defaults to 200
	StatusCode int
}

type FakeHandler

type FakeHandler struct {
	// if non-zero, forces this status code for all responses.
	StatusCode int
}

func (FakeHandler) ServeHTTP

func (h FakeHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type RunOptions

type RunOptions struct {
	ShutdownTimeout time.Duration
}

type TLSOptions

type TLSOptions struct {
	CertFile string
	KeyFile  string
}

Jump to

Keyboard shortcuts

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