server

package
v0.0.0-...-38e095d Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

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

Server acts as an HTTP proxy, returning entries from the cache whenever possible. Recognized archive mirrors are silently rewritten to avoid needless duplication.

func NewServer

func NewServer(addr, directory string) (*Server, error)

NewServer creates a new server.

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, req *http.Request)

ServeHTTP processes an incoming request to the proxy. GET requests are served with the storage backend and every other request is (out of necessity) rejected since it can't be cached.

func (*Server) Start

func (s *Server) Start() error

Start initializes the server and begins listening for requests.

func (*Server) Stop

func (s *Server) Stop()

Stop shuts down the server.

Jump to

Keyboard shortcuts

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