Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanPath ¶
CleanPath is the URL version of path.Clean, it returns a canonical URL path for p, eliminating . and .. elements.
The following rules are applied iteratively until no further processing can be done:
- Replace multiple slashes with a single slash.
- Eliminate each . path name element (the current directory).
- Eliminate each inner .. path name element (the parent directory) along with the non-.. element that precedes it.
- Eliminate .. elements that begin a rooted path: that is, replace "/.." by "/" at the beginning of a path.
If the result of this process is an empty string, "/" is returned.
func Dir ¶
func Dir(root string, listDirectory bool) http.FileSystem
Dir returns a http.Filesystem that can be used by http.FileServer(). It is used internally in router.Static(). in router.Static(). if listDirectory == true, then it works the same as http.Dir() otherwise it returns a filesystem that prevents http.FileServer() to list the directory files.
Types ¶
type Error ¶
func (*Error) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface.
type ErrorMsgs ¶
type ErrorMsgs []*Error
func (ErrorMsgs) ByType ¶
ByType returns a readonly copy filtered the byte. ie ByType(util.ErrorTypePublic) returns a slice of errors with type = ErrorTypePublic.
func (ErrorMsgs) Errors ¶
Errors returns an array will all the error messages. Example:
c.Error(errors.New("first")) c.Error(errors.New("second")) c.Error(errors.New("third")) c.Errors.Errors() // == []string{"first", "second", "third"}
func (ErrorMsgs) Last ¶
Last returns the last error in the slice. It returns nil if the array is empty. Shortcut for errors[len(errors)-1].
func (ErrorMsgs) MarshalJSON ¶
type OnlyfilesFS ¶
type OnlyfilesFS struct {
// contains filtered or unexported fields
}