http

package
v2.9.0-nightly.20240108 Latest Latest
Warning

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

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

Documentation

Overview

Package http is a browser-targeted HTTP server for Pachyderm. It includes what used to be called the "archive server" (for /archive/ downloads) and the "file server" (for /pfs/ downloads). Any future user-facing HTTP services should be added here.

The general design here is for the servers to be relatively untrusted. They build a PachClient based on the HTTP request, and then make ordinary API calls.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CSRFWrapper

func CSRFWrapper(h http.Handler) http.HandlerFunc

CSRFWrapper is an http.Handler that provides CSRF protection to the underlying handler.

Types

type Server

type Server struct {
	Server *http.Server // For ListenAndServe.
	// contains filtered or unexported fields
}

Server is an http.Server that serves public requests.

func New

func New(ctx context.Context, port uint16, pachClientFactory func(ctx context.Context) *client.APIClient) (*Server, error)

New creates a new API server, with an http.Server to actually serve traffic.

func (*Server) ListenAndServe

func (h *Server) ListenAndServe(ctx context.Context) error

ListenAndServe begins serving the server, and returns when the context is canceled or the server dies on its own.

Jump to

Keyboard shortcuts

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