Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
C
Coredns
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Railgun
Coredns
Commits
7fb95947
Commit
7fb95947
authored
Apr 03, 2016
by
Miek Gieben
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename Standard to Normalize
Some doc updates and tweaks.
parent
6ecbdef1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
5 deletions
+6
-5
middleware/file/notify.go
middleware/file/notify.go
+1
-0
middleware/host.go
middleware/host.go
+4
-4
middleware/zone.go
middleware/zone.go
+1
-1
No files found.
middleware/file/notify.go
View file @
7fb95947
...
@@ -4,6 +4,7 @@ import (
...
@@ -4,6 +4,7 @@ import (
"fmt"
"fmt"
"github.com/miekg/coredns/middleware"
"github.com/miekg/coredns/middleware"
"github.com/miekg/dns"
"github.com/miekg/dns"
)
)
...
...
middleware/host.go
View file @
7fb95947
...
@@ -13,9 +13,9 @@ type (
...
@@ -13,9 +13,9 @@ type (
Addr
string
Addr
string
)
)
//
Standard
will return the host portion of host, stripping
//
Normalize
will return the host portion of host, stripping
// of any port. The host will also be fully qualified and lowercased.
// of any port. The host will also be fully qualified and lowercased.
func
(
h
Host
)
Standard
()
string
{
func
(
h
Host
)
Normalize
()
string
{
// separate host and port
// separate host and port
host
,
_
,
err
:=
net
.
SplitHostPort
(
string
(
h
))
host
,
_
,
err
:=
net
.
SplitHostPort
(
string
(
h
))
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -24,9 +24,9 @@ func (h Host) Standard() string {
...
@@ -24,9 +24,9 @@ func (h Host) Standard() string {
return
strings
.
ToLower
(
dns
.
Fqdn
(
host
))
return
strings
.
ToLower
(
dns
.
Fqdn
(
host
))
}
}
//
Standard
will return a normalized address, if not port is specified
//
Normalize
will return a normalized address, if not port is specified
// port 53 is added, otherwise the port will be left as is.
// port 53 is added, otherwise the port will be left as is.
func
(
a
Addr
)
Standard
()
string
{
func
(
a
Addr
)
Normalize
()
string
{
// separate host and port
// separate host and port
addr
,
port
,
err
:=
net
.
SplitHostPort
(
string
(
a
))
addr
,
port
,
err
:=
net
.
SplitHostPort
(
string
(
a
))
if
err
!=
nil
{
if
err
!=
nil
{
...
...
middleware/zone.go
View file @
7fb95947
...
@@ -24,7 +24,7 @@ func (z Zones) Matches(qname string) string {
...
@@ -24,7 +24,7 @@ func (z Zones) Matches(qname string) string {
return
zone
return
zone
}
}
// Fully
qualify all zones in z
// Fully
Qualify fully qualifies all zones in z.
func
(
z
Zones
)
FullyQualify
()
{
func
(
z
Zones
)
FullyQualify
()
{
for
i
,
_
:=
range
z
{
for
i
,
_
:=
range
z
{
z
[
i
]
=
dns
.
Fqdn
(
z
[
i
])
z
[
i
]
=
dns
.
Fqdn
(
z
[
i
])
...
...
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