preview

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	File          string
	Port          int
	WatchDirs     []string
	Extensions    []string
	IncludeGlobs  []string
	ExcludeGlobs  []string
	DebounceDelay time.Duration
	Verbose       bool
	OpenBrowser   bool
	Theme         string
	CustomCSS     string
	Timeout       time.Duration
	OnReady       func(port int)
}

func DefaultConfig

func DefaultConfig() Config

type LiveReload

type LiveReload struct {
	// contains filtered or unexported fields
}

func NewLiveReload

func NewLiveReload() *LiveReload

func (*LiveReload) ClientCount

func (lr *LiveReload) ClientCount() int

func (*LiveReload) HandleWebSocket

func (lr *LiveReload) HandleWebSocket(w http.ResponseWriter, r *http.Request)

func (*LiveReload) Reload

func (lr *LiveReload) Reload()

type Server

type Server struct {
	// contains filtered or unexported fields
}

func New

func New(cfg Config, parser *hype.Parser) *Server

func (*Server) Port

func (s *Server) Port() int

func (*Server) Run

func (s *Server) Run(ctx context.Context, pwd string) error

func (*Server) SetOutput

func (s *Server) SetOutput(stdout, stderr func(format string, args ...any))

Jump to

Keyboard shortcuts

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