Documentation ¶
Overview ¶
Copyright 2016 The Web BSD Hunt Authors.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
//////////////////////////////////////////////////////////////////////////////
TODO: High-level file comment.
Copyright 2016 The Web BSD Hunt Authors.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
//////////////////////////////////////////////////////////////////////////////
TODO: High-level file comment.
Copyright 2016 The Web BSD Hunt Authors.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
//////////////////////////////////////////////////////////////////////////////
TODO: High-level file comment.
Copyright 2016 The Web BSD Hunt Authors.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
//////////////////////////////////////////////////////////////////////////////
TODO: High-level file comment.
Copyright 2016 The Web BSD Hunt Authors.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
//////////////////////////////////////////////////////////////////////////////
TODO: High-level file comment.
Index ¶
- Constants
- Variables
- func CopyHeader(dst http.Header, src http.Header, key string)
- func DefaultVersionHostname(r *http.Request) string
- func Error(w http.ResponseWriter, r *http.Request, code int, msg string, logErr error)
- func GAEBackendInstance() (string, error)
- func HttpJsonRpc(r *http.Request, u *url.URL, method string, rpoptions uint64, ...) error
- func InternalServerError(w http.ResponseWriter, r *http.Request, msg string, logErr error)
- func Log(r *http.Request, msg string)
- func LogHeaders(ctx context.Context, msg string, headers http.Header)
- func LogRequestHeaders(r *http.Request, msg string)
- func ProjectID() (string, error)
- func RProxy(r *http.Request, cfg *RProxyConfig, method string, u *url.URL, data []byte) ([]byte, error)
- func RProxyOptions(str string) uint64
- func ServiceAccounts() ([]string, error)
- type AuthToken
- type Header
- type KeepAlive
- type KeepAliveMessage
- type RProxyConfig
- type ServiceAccount
Constants ¶
const ( RPROXY_LOG_REQUEST_HEADERS = 1 << 0 RPROXY_LOG_RESPONSE_HEADERS = 1 << 1 RPROXY_LOG_ERROR = 1 << 2 RPROXY_LOG_SUCCESS = 1 << 3 RPROXY_LOG_PROXY_REQUEST = 1 << 5 RPROXY_LOG_PROXY_HEADERS = 1 << 6 RPROXY_DISABLE_REDIRECT = 1 << 7 )
const (
DEBUG = false
)
Variables ¶
var ErrKeepaliveTimeout = errors.New("Keepalive timeout")
var ErrRedirect = errors.New("redirect foiled")
Functions ¶
func DefaultVersionHostname ¶
func GAEBackendInstance ¶
func HttpJsonRpc ¶
func HttpJsonRpc(r *http.Request, u *url.URL, method string, rpoptions uint64, request interface{}, reply interface{}) error
* This method and the supporting RProxy() function are purpose built for App Engine, * And more specifically for Appengine apps that want to either * talk between modules in the same app, or talk between apps.
func InternalServerError ¶
* TODO(tadhunt): replace hacky wrapper around open source http logging library to correctly * log appengine errors with something better
func LogRequestHeaders ¶
func RProxyOptions ¶
func ServiceAccounts ¶
Types ¶
type AuthToken ¶
type AuthToken struct { Type string `json:"token_type"` Token string `json:"access_token"` Expiry uint `json:"expires_in"` }
func GetAuthToken ¶
type KeepAlive ¶
type KeepAlive struct {
// contains filtered or unexported fields
}
func NewKeepAlive ¶
type KeepAliveMessage ¶
func ParseKeepAliveMessage ¶
func ParseKeepAliveMessage(m *pubsub.Message) (*KeepAliveMessage, error)
func (*KeepAliveMessage) String ¶
func (m *KeepAliveMessage) String() string
type RProxyConfig ¶
type ServiceAccount ¶
type ServiceAccount struct { Aliases []string `json:"aliases"` Email string `json:"email"` Scopes []string `json:"scopes"` }
func GetServiceAccount ¶
func GetServiceAccount(name string) (*ServiceAccount, error)