Documentation
¶
Index ¶
- Constants
- func InferVersion(defaultVersion model.WebVersion, h http.Handler) http.Handler
- func NewDevServer(packageDir PackageDir, devPort model.WebDevPort) (*devServer, error)
- func NewFakeServer() fakeServer
- func NewProdServer(bucket AssetBucket, version model.WebVersion) (prodServer, error)
- func RewriteContentURLs(req *http.Request, content []byte) []byte
- func StripPrefix(prefix string, h http.Handler) http.Handler
- type AssetBucket
- type PackageDir
- type PublicPathPrefixContextKey
- type Server
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 PackageDir ¶ added in v0.10.14
type PackageDir string
The directory where the package.json where our JS source code lives.
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 GetEmbeddedServer ¶ added in v0.26.3
func GetEmbeddedServer() (Server, bool)
Click to show internal directories.
Click to hide internal directories.