https

package
Version: v0.0.0-...-cbf6b04 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2022 License: BSD-3-Clause Imports: 16 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 GCS bucket to use with AutocertAddr.
	AutocertBucket string
	// If non-empty, listen on this address and serve HTTPS using a Let's Encrypt cert stored in AutocertBucket.
	AutocertAddr 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
}

Source Files

Jump to

Keyboard shortcuts

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