https

package
v0.0.0-...-a1d368b Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2025 License: BSD-3-Clause Imports: 20 Imported by: 0

README

Go Reference

golang.org/x/build/internal/https

Package https contains helpers for starting an HTTP/HTTPS server.

Documentation

Overview

Package https contains helpers for starting an HTTP/HTTPS server.

Index

Constants

This section is empty.

Variables

View Source
var DefaultOptions = &Options{}

Functions

func ListenAndServe

func ListenAndServe(ctx context.Context, handler http.Handler) error

ListenAndServe runs the servers configured by DefaultOptions. It always returns a non-nil error.

func ListenAndServeOpts

func ListenAndServeOpts(ctx context.Context, handler http.Handler, opts *Options) error

ListenAndServeOpts runs the servers configured by opts. It always returns a non-nil error.

func RegisterFlags

func RegisterFlags(set *flag.FlagSet)

RegisterFlags registers flags that control DefaultOptions, which will be used with ListenAndServe below. Typical usage is to call RegisterFlags at the beginning of main, then ListenAndServe at the end.

Types

type Options

type Options struct {
	// Specifies the ACME directory to use to retrieve certificates.
	AutocertDirectory string
	// Specifies the ACME external account binding token to use. This should be
	// a JSON-encoded acme.ExternalAccountBinding struct.
	AutocertEAB string
	// Specifies the GCS bucket to use with AutocertAddr.
	AutocertBucket string
	// If non-empty, listen on this address and serve HTTPS using a cert stored in AutocertBucket.
	AutocertAddr string
	// Specifies the email address to use when creating an ACME account.
	AutocertEmail string
	// If non-empty, listen on this address and serve HTTPS using a self-signed cert.
	SelfSignedAddr string
	// If non-empty, listen on this address and serve HTTP.
	HTTPAddr string
	// If non-empty, respond unconditionally with 200 OK to requests on this path.
	HealthPath string
}

Jump to

Keyboard shortcuts

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