godoc: hide appengine dependencies behind build tags
Fixes the continuous build. Change-Id: If55b08c3b702ba705d84a30fdbce842438477883 Reviewed-on: https://go-review.googlesource.com/18241 Reviewed-by: Andrew Gerrand <adg@golang.org>
This commit is contained in:
parent
2dff1e88eb
commit
a8498a77d5
|
@ -2,6 +2,8 @@
|
||||||
// Use of this source code is governed by the Apache 2.0
|
// Use of this source code is governed by the Apache 2.0
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
// +build appengine
|
||||||
|
|
||||||
// Package dl implements a simple downloads frontend server.
|
// Package dl implements a simple downloads frontend server.
|
||||||
//
|
//
|
||||||
// It accepts HTTP POST requests to create a new download metadata entity, and
|
// It accepts HTTP POST requests to create a new download metadata entity, and
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
// Use of this source code is governed by the Apache 2.0
|
// Use of this source code is governed by the Apache 2.0
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
// +build appengine
|
||||||
|
|
||||||
package dl
|
package dl
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
// Use of this source code is governed by the Apache 2.0
|
// Use of this source code is governed by the Apache 2.0
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
// +build appengine
|
||||||
|
|
||||||
package dl
|
package dl
|
||||||
|
|
||||||
// TODO(adg): refactor this to use the tools/godoc/static template.
|
// TODO(adg): refactor this to use the tools/godoc/static template.
|
||||||
|
|
|
@ -1,13 +0,0 @@
|
||||||
// Copyright 2015 The Go Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style
|
|
||||||
// license that can be found in the LICENSE file.
|
|
||||||
|
|
||||||
// +build appengine
|
|
||||||
|
|
||||||
package proxy
|
|
||||||
|
|
||||||
import "google.golang.org/appengine"
|
|
||||||
|
|
||||||
func init() {
|
|
||||||
onAppengine = !appengine.IsDevAppServer()
|
|
||||||
}
|
|
|
@ -2,6 +2,8 @@
|
||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
// +build appengine
|
||||||
|
|
||||||
// Package proxy proxies requests to the sandbox compiler service and the
|
// Package proxy proxies requests to the sandbox compiler service and the
|
||||||
// playground share handler.
|
// playground share handler.
|
||||||
// It is designed to run only on the instance of godoc that serves golang.org.
|
// It is designed to run only on the instance of godoc that serves golang.org.
|
||||||
|
@ -155,10 +157,8 @@ func share(w http.ResponseWriter, r *http.Request) {
|
||||||
p.ServeHTTP(w, r)
|
p.ServeHTTP(w, r)
|
||||||
}
|
}
|
||||||
|
|
||||||
var onAppengine = false // will be overriden by appengine.go and appenginevm.go
|
|
||||||
|
|
||||||
func allowShare(r *http.Request) bool {
|
func allowShare(r *http.Request) bool {
|
||||||
if !onAppengine {
|
if appengine.IsDevAppServer() {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
switch r.Header.Get("X-AppEngine-Country") {
|
switch r.Header.Get("X-AppEngine-Country") {
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
// Use of this source code is governed by the Apache 2.0
|
// Use of this source code is governed by the Apache 2.0
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
// +build appengine
|
||||||
|
|
||||||
// Package short implements a simple URL shortener, serving an administrative
|
// Package short implements a simple URL shortener, serving an administrative
|
||||||
// interface at /s and shortened urls from /s/key.
|
// interface at /s and shortened urls from /s/key.
|
||||||
// It is designed to run only on the instance of godoc that serves golang.org.
|
// It is designed to run only on the instance of godoc that serves golang.org.
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
// Use of this source code is governed by the Apache 2.0
|
// Use of this source code is governed by the Apache 2.0
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
// +build appengine
|
||||||
|
|
||||||
package short
|
package short
|
||||||
|
|
||||||
const templateHTML = `
|
const templateHTML = `
|
||||||
|
|
Loading…
Reference in New Issue