Documentation ¶
Index ¶
Constants ¶
View Source
const ScriptContent string = `` /* 416-byte string literal not displayed */
Variables ¶
This section is empty.
Functions ¶
func NewFileServer ¶ added in v0.2.0
NewFileServer creates a new middleware for single page applications
Types ¶
type Broker ¶
type Broker struct { // Channel into which messages are pushed to be broadcast out // to attahed clients. // Messages chan string // contains filtered or unexported fields }
Broker is responsible for keeping a list of which clients (browsers) are currently attached and broadcasting events (messages) to those clients.
type FileWatcher ¶
type FileWatcher struct { Handler http.Handler Broker *Broker Watcher chan notify.EventInfo Extensions []string }
FileWatcher recursively watches the served directory for changes
func NewFileWatcher ¶
func NewFileWatcher(dir, ext string, h http.Handler) *FileWatcher
NewFileWatcher returns a new file watcher
type InjectMiddleware ¶
type InjectMiddleware struct {
// contains filtered or unexported fields
}
InjectMiddleware intercepts the response and modifies it in some way
func (*InjectMiddleware) ServeHTTP ¶
func (m *InjectMiddleware) ServeHTTP(w http.ResponseWriter, r *http.Request)
type SPAMiddleware ¶ added in v0.2.0
type SPAMiddleware struct {
// contains filtered or unexported fields
}
SPAMiddleware intercepts the response and modifies it in some way
func (*SPAMiddleware) ServeHTTP ¶ added in v0.2.0
func (m *SPAMiddleware) ServeHTTP(w http.ResponseWriter, r *http.Request)
Click to show internal directories.
Click to hide internal directories.