Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileResolver ¶
type FileResolver interface { // Read the location of the given file and return it's // contents or an error. Read(string) ([]byte, error) // Resolve the location of the given file Resolve(string) (string, error) }
FileResolver interface to try and resolve the location of a given file.
type GoPathResolver ¶
type GoPathResolver struct { Path string *RecursiveResolver }
GoPathResolver will search your entire $GOPATH to find the file in question. I wouldn't really recommend using this approach. It's very very slow the first you try to find a file, and there is no guarantees of finding the right now.
func (*GoPathResolver) Read ¶
func (g *GoPathResolver) Read(name string) ([]byte, error)
Read will search your entire $GOPATH to find the file in question. I wouldn't really recommend using this approach. It's very very slow the first you try to find a file, and there is no guarantees of finding the right now.
func (*GoPathResolver) Resolve ¶
func (g *GoPathResolver) Resolve(name string) (string, error)
Resolve will search your entire $GOPATH to find the file in question. I wouldn't really recommend using this approach. It's very very slow the first you try to find a file, and there is no guarantees of finding the right now.
type RecursiveResolver ¶
type RecursiveResolver struct { Path string // contains filtered or unexported fields }
RecursiveResolver will walk the tree of the specified RootPath to resolve the given file name to the a path on disk. It is recommended to scope this as tight as possible as it is possibly quite slow the first time a file is requested. Once a file is found it's resolved path is cached to prevent further slow resolutions.
func (*RecursiveResolver) Read ¶
func (r *RecursiveResolver) Read(name string) ([]byte, error)
Read will walk the tree of the specified RootPath to resolve the given file name to the a path on disk. It is recommended to scope this as tight as possible as it is possibly quite slow the first time a file is requested. Once a file is found it's resolved path is cached to prevent further slow resolutions.
func (*RecursiveResolver) Resolve ¶
func (r *RecursiveResolver) Resolve(name string) (string, error)
Resolve will walk the tree of the specified RootPath to resolve the given file name to the a path on disk. It is recommended to scope this as tight as possible as it is possibly quite slow the first time a file is requested. Once a file is found it's resolved path is cached to prevent further slow resolutions.
type RiceBox ¶
RiceBox uses the go.rice package to resolve files
type SimpleResolver ¶
type SimpleResolver struct{}
SimpleResolver is dumb and will just look for the file exactly where you ask for it.