lib

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 23, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultPort int = 9999

Variables

This section is empty.

Functions

func InjectHtml

func InjectHtml(r *http.Request, html []byte) []byte

returns HTML with reload script injected, only if enabled

func ServerStart

func ServerStart(option *ServerOptions)

Start a HTTP & WebSocket server

func WatchStart

func WatchStart(watch []string, exclude []string)

func WithReload

func WithReload(next http.Handler) http.HandlerFunc

func WriteHtml

func WriteHtml(w http.ResponseWriter, r *http.Request, html []byte)

Write Html writes HTML with reload script injected, only if enabled

Types

type ServerOptions

type ServerOptions struct {
	Port int
	Host *url.URL
}

============================================================ Server Options ============================================================

func NewServerOption

func NewServerOption() *ServerOptions

func (*ServerOptions) SetForwardHost

func (s *ServerOptions) SetForwardHost(h string) error

func (*ServerOptions) SetPort

func (s *ServerOptions) SetPort(port int) error

type WatchOptions

type WatchOptions struct {
	Dirs   []string
	Ignore []string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL