diff options
Diffstat (limited to 'middleware/name.go')
-rw-r--r-- | middleware/name.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/middleware/name.go b/middleware/name.go new file mode 100644 index 000000000..f866a3865 --- /dev/null +++ b/middleware/name.go @@ -0,0 +1,15 @@ +package middleware + +import "strings" + +// Name represents a domain name. +type Name string + +// Matches checks to see if other matches n. +// +// Name matching will probably not always be a direct +// comparison; this method assures that names can be +// easily and consistently matched. +func (n Name) Matches(other string) bool { + return strings.HasSuffix(string(n), other) +} |