https

package
v0.1.13 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Overview

Package https implements an https-based server Communicator. It is the primary way for clients to communicate with the FS server.

Index

Constants

View Source
const (
	// MaxContactSize is the largest contact (in bytes) that we will accept.
	MaxContactSize = 20 * 1024 * 1024
)

Variables

This section is empty.

Functions

func GetClientCert

func GetClientCert(req *http.Request, frontendConfig *cpb.FrontendConfig) (*x509.Certificate, error)

GetClientCert returns the client certificate from either the request header or TLS connection state.

Types

type Communicator

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

Communicator implements server.Communicator, and accepts client connections over HTTPS.

func NewCommunicator

func NewCommunicator(p Params) (*Communicator, error)

NewCommunicator creates a Communicator, which listens through l and identifies itself using certFile and keyFile.

func (*Communicator) Setup

func (c *Communicator) Setup(fs comms.Context) error

func (*Communicator) Start

func (c *Communicator) Start() error

func (*Communicator) Stop

func (c *Communicator) Stop()

type Params

type Params struct {
	Listener                    net.Listener        // Where to listen for connections, required.
	Cert, Key                   []byte              // x509 encoded certificate and matching private key, required.
	Streaming                   bool                // Whether to enable streaming communications.
	FrontendConfig              *cpb.FrontendConfig // Configure how the frontend identifies and communicates with clients
	StreamingLifespan           time.Duration       // Maximum time to keep a streaming connection open, defaults to 10 min.
	StreamingCloseTime          time.Duration       // How much of StreamingLifespan to allocate to an orderly stream close, defaults to 30 sec.
	StreamingJitter             time.Duration       // Maximum amount of jitter to add to StreamingLifespan.
	MaxPerClientBatchProcessors uint32              // Maximum number of concurrent processors for messages coming from a single client.
}

Params wraps the parameters required to create an https communicator.

Jump to

Keyboard shortcuts

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