Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ResponseWrite ¶
type ResponseWrite struct {
// contains filtered or unexported fields
}
ResponseWrite is http.ResponseWriter interface implementation.
func NewResponseWrite ¶
func NewResponseWrite(w http.ResponseWriter, rw Rewriter) *ResponseWrite
func (*ResponseWrite) Header ¶
func (w *ResponseWrite) Header() http.Header
func (*ResponseWrite) Write ¶
func (w *ResponseWrite) Write(p []byte) (int, error)
Write writes content which is returned from Rewriter to p.
func (*ResponseWrite) WriteHeader ¶
func (w *ResponseWrite) WriteHeader(statusCode int)
type Rule ¶
type Rule []*Replace
Rule is slice of Replace
func (*Rule) Map ¶
Map provides wrapper of http.Handler. Map returns http.Handler. By passing http.Handler, Map autonatically rewrite the content which handler write out.
func (*Rule) MapFunc ¶
func (rl *Rule) MapFunc(hf http.HandlerFunc) http.Handler
MapFunc provides wrapper of http.HandlerFunc. MapFunc returns http.Handler. By passing http.Handler, Map autonatically rewrite the content which handler write out.
func (*Rule) Rewrite ¶
Rewrite is implementation of Rewriter. If the content is binary, Rewrite returns original content.
func (*Rule) ToReplacer ¶
Replacer returns strings.Replacer by converting from Rule to strings.Replacer