Documentation
¶
Index ¶
- Constants
- func Fqn(value ...string) string
- func IsIdentifier(s string) bool
- func IsWritableDir(path string) (bool, error)
- func MD5Hash(data []byte) string
- func ServeEmpty(w http.ResponseWriter, code uint)
- func ServeError(w http.ResponseWriter, code uint, reason ...string) error
- func ServeJSON(w http.ResponseWriter, v interface{}, code, indent uint) error
- func ServeText(w http.ResponseWriter, v string, code uint)
- func Unfqn(value, domain string) string
- type ErrorResponse
Constants ¶
View Source
const ( ContentTypeKey = "Content-Type" ContentLengthKey = "Content-Length" ContentTypeJSON = "application/json" ContentTypeText = "text/plain" )
View Source
const (
ReIdentifier = `[a-zA-Z][a-zA-Z0-9_\-]+`
)
Variables ¶
This section is empty.
Functions ¶
func IsIdentifier ¶
func IsWritableDir ¶
IsWritableDir returns true if the given directory path is writable
func ServeEmpty ¶
func ServeEmpty(w http.ResponseWriter, code uint)
ServeEmpty is a utility function to serve an empty response
func ServeError ¶
func ServeError(w http.ResponseWriter, code uint, reason ...string) error
ServeError is a utility function to serve a JSON error notice
func ServeJSON ¶
func ServeJSON(w http.ResponseWriter, v interface{}, code, indent uint) error
ServeJSON is a utility function to serve an arbitary object as JSON
Types ¶
type ErrorResponse ¶
Click to show internal directories.
Click to hide internal directories.