bouncer

package
v0.0.0-...-c47db5f Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bouncer

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

Bouncer handles HTTP requests for Go imports by retrieving a configuration file, finding a matching package prefix, and serving an appropriate redirect.

func New

func New(configURL string) (*Bouncer, error)

New creates a new Bouncer using the configuration from the provided URL. The following URL schemes are supported:

https://{path...}               Retrieve via HTTPS request
http://{path...}                Retrieve via HTTP request
file://{path...}                Retrieve from the local filesystem
s3://{bucket}/{path...}         Retrieve from Amazon S3 with HTTPS
s3+nossl://{bucket}/{path...}   Retrieve from Amazon S3 with HTTP

func (*Bouncer) ServeHTTP

func (b *Bouncer) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP fetches a fresh copy of the Bouncer configuration and serves the appropriate redirect to an HTTP client.

Jump to

Keyboard shortcuts

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