Small golint cleanup (#977)
* Small golint cleanup Mostly docs in autopath. * duh
This commit is contained in:
parent
10b7221067
commit
9c62ddaa01
1 changed files with 6 additions and 6 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
Autopath package implement autopathing. This is a hack; it shortcuts the
|
Package autopath implements autopathing. This is a hack; it shortcuts the
|
||||||
client's search path resolution by performing these lookups on the server...
|
client's search path resolution by performing these lookups on the server...
|
||||||
|
|
||||||
The server has a copy (via AutoPathFunc) of the client's search path and on
|
The server has a copy (via AutoPathFunc) of the client's search path and on
|
||||||
|
@ -21,7 +21,7 @@ through the search path.
|
||||||
It is assume the search path ordering is identical between server and client.
|
It is assume the search path ordering is identical between server and client.
|
||||||
|
|
||||||
Midldeware implementing autopath, must have a function called `AutoPath` of type
|
Midldeware implementing autopath, must have a function called `AutoPath` of type
|
||||||
AutoPathFunc. Note the searchpath must be ending with the empty string.
|
autopath.Func. Note the searchpath must be ending with the empty string.
|
||||||
|
|
||||||
I.e:
|
I.e:
|
||||||
|
|
||||||
|
@ -43,10 +43,10 @@ import (
|
||||||
"golang.org/x/net/context"
|
"golang.org/x/net/context"
|
||||||
)
|
)
|
||||||
|
|
||||||
// AutoPathFunc defines the function middleware should implement to return a search
|
// Func defines the function middleware should implement to return a search
|
||||||
// path to the autopath middleware. The last element of the slice must be the empty string.
|
// path to the autopath middleware. The last element of the slice must be the empty string.
|
||||||
// If AutoPathFunc returns a nil slice, no autopathing will be done.
|
// If Func returns a nil slice, no autopathing will be done.
|
||||||
type AutoPathFunc func(request.Request) []string
|
type Func func(request.Request) []string
|
||||||
|
|
||||||
// AutoPath perform autopath: service side search path completion.
|
// AutoPath perform autopath: service side search path completion.
|
||||||
type AutoPath struct {
|
type AutoPath struct {
|
||||||
|
@ -55,7 +55,7 @@ type AutoPath struct {
|
||||||
|
|
||||||
// Search always includes "" as the last element, so we try the base query with out any search paths added as well.
|
// Search always includes "" as the last element, so we try the base query with out any search paths added as well.
|
||||||
search []string
|
search []string
|
||||||
searchFunc AutoPathFunc
|
searchFunc Func
|
||||||
}
|
}
|
||||||
|
|
||||||
// ServeDNS implements the middleware.Handle interface.
|
// ServeDNS implements the middleware.Handle interface.
|
||||||
|
|
Loading…
Add table
Reference in a new issue