Documentation ¶
Index ¶
- func ExpandPath(elem ...string) (string, error)
- func FileExists(elem ...string) bool
- func HttpToHttps()
- func JsonMarshal(path string, v interface{}) error
- func JsonUnmarshal(path string, v interface{}) error
- func ListenAndServeTLSWithLogging(addr string, handler http.Handler, crtPath, keyPath string) error
- func ListenAndServeWithLogging(addr string, handler http.Handler) error
- type PrefixLogger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExpandPath ¶
ExpandPath: Expand the path to its full path.
func FileExists ¶
fileExists: Return true if the path exists. Arguments are joined with filepath.Join to construct the full path.
func HttpToHttps ¶
func HttpToHttps()
HttpToHttps: Accept connections on port 80 and forward to the same host using https. This will run in an infinite loop, or panic if it can't listen.
func JsonMarshal ¶
JsonMarshal: attempt to write out the given object as json into the given file. This function won't overwrite an existing file.
func JsonUnmarshal ¶
JsonUnmarshal: attempt to unmarshal the json file into the given object.
Types ¶
type PrefixLogger ¶
type PrefixLogger struct {
// contains filtered or unexported fields
}
func NewPrefixLogger ¶
func NewPrefixLogger(prefix string) *PrefixLogger
func (*PrefixLogger) Err ¶
func (pl *PrefixLogger) Err(err error, format string, v ...interface{})
Err: Prints the error with the given message. Appends a colon and a newline to the message.
func (*PrefixLogger) Msg ¶
func (pl *PrefixLogger) Msg(format string, v ...interface{})
Msg: Just link Printf, but adds an additional newline to the end of the message.