Documentation
¶
Index ¶
- Constants
- func LogHeader(log termlog.Logger, h http.Header)
- func WatchPaths(paths, excludePatterns []string, reloader Reloader, log termlog.Logger) error
- func WatchRoutes(routes RouteCollection, reloader Reloader, excludePatterns []string, ...) error
- type Devd
- type Reloader
- type ResponseLogWriter
- type Route
- type RouteCollection
Constants ¶
const (
// Version is the current version of devd
Version = "0.2"
)
Variables ¶
This section is empty.
Functions ¶
func WatchPaths ¶
WatchPaths watches a set of paths, and broadcasts changes through reloader.
func WatchRoutes ¶
func WatchRoutes(routes RouteCollection, reloader Reloader, excludePatterns []string, log termlog.Logger) error
WatchRoutes watches the route collection, and broadcasts changes through reloader.
Types ¶
type Devd ¶
type Devd struct {
Routes []string
OpenBrowser bool
CertFile string
// Listening address
Address string
Port int
// Shaping
Latency int
DownKbps uint
UpKbps uint
// Livereload
LivereloadRoutes bool
Watch []string
Excludes []string
// Logging
IgnoreLogs []string
}
Devd represents the devd server options
func (*Devd) LivereloadEnabled ¶
LivereloadEnabled tells us if liverload is enabled
type ResponseLogWriter ¶
type ResponseLogWriter struct {
Log termlog.Logger
Resp http.ResponseWriter
Timer *timer.Timer
// contains filtered or unexported fields
}
ResponseLogWriter is a ResponseWriter that logs
func (*ResponseLogWriter) Header ¶
func (rl *ResponseLogWriter) Header() http.Header
Header returns the header map that will be sent by WriteHeader. Changing the header after a call to WriteHeader (or Write) has no effect.
func (*ResponseLogWriter) Write ¶
func (rl *ResponseLogWriter) Write(data []byte) (int, error)
Write writes the data to the connection as part of an HTTP reply. If WriteHeader has not yet been called, Write calls WriteHeader(http.StatusOK) before writing the data. If the Header does not contain a Content-Type line, Write adds a Content-Type set to the result of passing the initial 512 bytes of written data to DetectContentType.
func (*ResponseLogWriter) WriteHeader ¶
func (rl *ResponseLogWriter) WriteHeader(code int)
WriteHeader sends an HTTP response header with status code. If WriteHeader is not called explicitly, the first call to Write will trigger an implicit WriteHeader(http.StatusOK). Thus explicit calls to WriteHeader are mainly used to send error codes.
type Route ¶
Route is a mapping from a (host, path) tuple to an endpoint.
type RouteCollection ¶
RouteCollection is a collection of routes
func (RouteCollection) Set ¶
func (f RouteCollection) Set(value string) error
Set adds a route to the collection
func (*RouteCollection) String ¶
func (f *RouteCollection) String() string
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
devd
command
|
|
|
Package fileserver provides a filesystem HTTP handler, based on the built-in Go FileServer.
|
Package fileserver provides a filesystem HTTP handler, based on the built-in Go FileServer. |
|
Package httpctx provides a context-aware HTTP handler adaptor
|
Package httpctx provides a context-aware HTTP handler adaptor |
|
Package inject gives the ability to copy data and inject a payload before a specified marker.
|
Package inject gives the ability to copy data and inject a payload before a specified marker. |
|
Package livereload allows HTML pages to be dynamically reloaded.
|
Package livereload allows HTML pages to be dynamically reloaded. |
|
Package reverseproxy is a reverse proxy implementation based on the built-in httuptil.Reverseproxy.
|
Package reverseproxy is a reverse proxy implementation based on the built-in httuptil.Reverseproxy. |
|
Package ricetemp makes templates from a ricebox.
|
Package ricetemp makes templates from a ricebox. |
|
Package slowdown provides an implementation of net.Listener that limits bandwidth.
|
Package slowdown provides an implementation of net.Listener that limits bandwidth. |
|
Package termlog provides facilities for logging to a terminal geared towards interactive use.
|
Package termlog provides facilities for logging to a terminal geared towards interactive use. |
|
_termlog_demo
command
|
|
|
Package timer adds HTTP request and response timing information to a context.
|
Package timer adds HTTP request and response timing information to a context. |

