assets

package
v0.10.24 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2019 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const ProdAssetBucket = AssetBucket("https://storage.googleapis.com/tilt-static-assets/")
View Source
const WebVersionKey = "web_version"

Variables

This section is empty.

Functions

func InferVersion added in v0.10.16

func InferVersion(defaultVersion model.WebVersion, h http.Handler) http.Handler

Middleware that injects version information into the request. We rewrite the URL to contain the version.

If no default version is passed, and we can't find the version in the url path, we will write a 500 error.

func NewDevServer added in v0.10.14

func NewDevServer(packageDir PackageDir, devPort model.WebDevPort) (*devServer, error)

func NewFakeServer

func NewFakeServer() fakeServer

func NewProdServer added in v0.10.14

func NewProdServer(bucket AssetBucket, version model.WebVersion) (prodServer, error)

func RewriteContentURLs added in v0.10.16

func RewriteContentURLs(req *http.Request, content []byte) []byte

func StripPrefix added in v0.10.16

func StripPrefix(prefix string, h http.Handler) http.Handler

Middleware that attaches a server at a subpath. Modeled after http.StripPrefix, but attaches the work it did to the Request Context.

Types

type AssetBucket added in v0.10.14

type AssetBucket string

A URL where assets live.

func (AssetBucket) String added in v0.10.14

func (b AssetBucket) String() string

type PackageDir added in v0.10.14

type PackageDir string

The directory where the package.json where our JS source code lives.

func (PackageDir) String added in v0.10.14

func (d PackageDir) String() string

type PublicPathPrefixContextKey added in v0.10.16

type PublicPathPrefixContextKey struct{}

type Server

type Server interface {
	http.Handler
	Serve(ctx context.Context) error
	TearDown(ctx context.Context)
}

func NewPrecompiledServer added in v0.10.14

func NewPrecompiledServer(packageDir PackageDir) Server

Jump to

Keyboard shortcuts

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