Documentation ¶
Index ¶
- func CopyDir(dst, src string) error
- func FileExists(filename string) bool
- func InjectVarsIntoIndex(indexFile []byte, entryFileName, assetsDir, publicUrl string) ([]byte, bool)
- func IsErrorAddressAlreadyInUse(err error) bool
- func PipedFileServer(baseDir string, pipe http.HandlerFunc) http.HandlerFunc
- func PipedFileServerWithMiddleware(baseDir string, pipe http.HandlerFunc, ...) http.HandlerFunc
- func RealQuickPath(fpath string) string
- func Realpath(fpath string) (string, error)
- func WrappedFileServer(baseDir string) http.HandlerFunc
- type Broker
- type NotFoundRedirectRespWr
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InjectVarsIntoIndex ¶
func InjectVarsIntoIndex(indexFile []byte, entryFileName, assetsDir, publicUrl string) ([]byte, bool)
InjectVarsIntoIndex injects js/css import to index.html content, returns bool if injected into content
func IsErrorAddressAlreadyInUse ¶
IsErrorAddressAlreadyInUse checks if the error is bind: address already in use OR alternative
func PipedFileServer ¶
func PipedFileServer(baseDir string, pipe http.HandlerFunc) http.HandlerFunc
PipedFileServer wraps your http.FileServer with neutered fs to remove dir browsing and pipes 404 to next handler
func PipedFileServerWithMiddleware ¶
func PipedFileServerWithMiddleware(baseDir string, pipe http.HandlerFunc, middleware func(http.HandlerFunc) http.HandlerFunc) http.HandlerFunc
PipedFileServerWithMiddleware wraps PipedFileServer with middleware
func RealQuickPath ¶
RealQuickPath just quickly gets path, without caring about errors
func WrappedFileServer ¶
func WrappedFileServer(baseDir string) http.HandlerFunc
WrappedFileServer wraps your http.FileServer with neutered fs to remove dir browsing and redirects 404 to index.html
Types ¶
type Broker ¶
type Broker struct { // Events are pushed to this channel by the main events-gathering routine Notifier chan []byte // contains filtered or unexported fields }
A Broker holds open client connections, listens for incoming events on its Notifier channel and broadcast event data to all registered connections
func NewStreamServer ¶
func NewStreamServer() (broker *Broker)
type NotFoundRedirectRespWr ¶
type NotFoundRedirectRespWr struct { http.ResponseWriter // We embed http.ResponseWriter // contains filtered or unexported fields }
NotFoundRedirectRespWr response for neutered fs
func (*NotFoundRedirectRespWr) Write ¶
func (w *NotFoundRedirectRespWr) Write(p []byte) (int, error)
func (*NotFoundRedirectRespWr) WriteHeader ¶
func (w *NotFoundRedirectRespWr) WriteHeader(status int)