Documentation ¶
Overview ¶
Diato - Reverse Proxying for Hipsters
Copyright 2016-2017 Dolf Schimmel ¶
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.
Diato - Reverse Proxying for Hipsters ¶
Copyright 2016-2017 Dolf Schimmel ¶
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.
Diato - Reverse Proxying for Hipsters ¶
Copyright 2016-2017 Dolf Schimmel ¶
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.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BufferPool ¶
A BufferPool is an interface for getting and returning temporary byte slices for use by io.CopyBuffer.
type ContextInfo ¶
type ContextInfo struct {
// contains filtered or unexported fields
}
func (*ContextInfo) RequestId ¶
func (i *ContextInfo) RequestId() int64
func (*ContextInfo) RequestIdString ¶
func (i *ContextInfo) RequestIdString() string
func (*ContextInfo) Sld ¶
func (i *ContextInfo) Sld() string
func (*ContextInfo) TimeStart ¶
func (i *ContextInfo) TimeStart() time.Time
func (*ContextInfo) UserAgent ¶
func (i *ContextInfo) UserAgent() *ua.UserAgent
type ModuleBase ¶
type ModuleBase struct { }
func (*ModuleBase) PostModifyResponse ¶
func (*ModuleBase) PostModifyResponse(*http.Request, *http.Response)
func (*ModuleBase) ProcessRequest ¶
func (*ModuleBase) ProcessRequest(*http.Request)
type ReverseProxy ¶
type ReverseProxy struct { // Director must be a function which modifies // the request into a new request to be sent // using Transport. Its response is then copied // back to the original client unmodified. // Director must not access the provided Request // after returning. Director func(*http.Request) // The transport used to perform proxy requests. // If nil, http.DefaultTransport is used. Transport http.RoundTripper // FlushInterval specifies the flush interval // to flush to the client while copying the // response body. // If zero, no periodic flushing is done. FlushInterval time.Duration // ErrorLog specifies an optional logger for errors // that occur when attempting to proxy the request. // If nil, logging goes to os.Stderr via the log package's // standard logger. ErrorLog *log.Logger // BufferPool optionally specifies a buffer pool to // get byte slices for use by io.CopyBuffer when // copying HTTP response bodies. BufferPool BufferPool // ModifyResponse is an optional function that // modifies the Response from the backend. // If it returns an error, the proxy returns a StatusBadGateway error. ModifyResponse func(*http.Response) error }
ReverseProxy is an HTTP Handler that takes an incoming request and sends it to another server, proxying the response back to the client.
func (*ReverseProxy) ServeHTTP ¶
func (p *ReverseProxy) ServeHTTP(rw http.ResponseWriter, req *http.Request)