Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
caddy
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Łukasz Nowak
caddy
Commits
a28d5585
Commit
a28d5585
authored
May 03, 2015
by
Nimi Wariboko Jr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Export Replacer type
parent
082ae70d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
middleware/replacer.go
middleware/replacer.go
+6
-2
No files found.
middleware/replacer.go
View file @
a28d5585
...
...
@@ -8,17 +8,21 @@ import (
"time"
)
//
r
eplacer is a type which can replace placeholder
//
R
eplacer is a type which can replace placeholder
// substrings in a string with actual values from a
// http.Request and responseRecorder. Always use
// NewReplacer to get one of these.
type
Replacer
interface
{
Replace
(
string
)
string
}
type
replacer
map
[
string
]
string
// NewReplacer makes a new replacer based on r and rr.
// Do not create a new replacer until r and rr have all
// the needed values, because this function copies those
// values into the replacer.
func
NewReplacer
(
r
*
http
.
Request
,
rr
*
responseRecorder
)
r
eplacer
{
func
NewReplacer
(
r
*
http
.
Request
,
rr
*
responseRecorder
)
R
eplacer
{
rep
:=
replacer
{
"{method}"
:
r
.
Method
,
"{scheme}"
:
func
()
string
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment