http

package
v0.0.0-...-3c02646 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2021 License: MPL-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AutoTLSOptions

type AutoTLSOptions struct {
	Domains    []string
	Email      string
	Production bool

	DNS         bool
	DNSProvider string
	DNSAPIToken string
}

AutoTLSOptions configures automatic TLS for Response Server's TCP server.

type Backend

type Backend interface {
	Database() *database.Database
	Cluster() cluster.Cluster
	Events() events.PubSub
}

Backend is implemented by a service capable of acting as the backend for the HTTP server.

type Options

type Options struct {
	BindAddress   string
	Port          int
	MaxUploadSize int
	TLS           *TLSOptions
	AutoTLS       *AutoTLSOptions

	ServeProfiler          bool
	ServeGraphQL           bool
	ServeGraphQLPlayground bool
}

Options configures Server.

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server is the TCP server that powers Response Server's HTTP(S) services.

func New

func New(logger log.Logger, backend Backend, options *Options) (*Server, error)

New creates a new http.Server instance and an internal multiplexer to handler HTTP routing.

func (*Server) Start

func (s *Server) Start() error

Start serves the HTTP(S) endpoints for Response Server.

type TLSOptions

type TLSOptions struct {
	Port     int
	CertPath string
	KeyPath  string
}

TLSOptions configured TLS for Response Server's TCP server.

Jump to

Keyboard shortcuts

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