hotreloader

package
v0.0.0-...-84fa8c7 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CloseFunction

type CloseFunction func()

type HotReloader

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

func New

func New(opts ...HotReloaderOption) (*HotReloader, error)

func (*HotReloader) AddConsumer

func (m *HotReloader) AddConsumer() (chan UpdateMessage, CloseFunction)

func (*HotReloader) Close

func (m *HotReloader) Close()

func (*HotReloader) IsHotReloadEnabled

func (m *HotReloader) IsHotReloadEnabled() bool

func (*HotReloader) Render

func (m *HotReloader) Render(w io.Writer, name string, data interface{}, c echo.Context) error

func (*HotReloader) Run

func (m *HotReloader) Run() error

func (*HotReloader) SetLogger

func (m *HotReloader) SetLogger(logger echo.Logger)

func (*HotReloader) WebSocketHandler

func (m *HotReloader) WebSocketHandler() websocket.Handler

type HotReloaderOption

type HotReloaderOption func(*HotReloader) error

func WithAutoReload

func WithAutoReload(val bool) HotReloaderOption

func WithHotReload

func WithHotReload(val bool) HotReloaderOption

func WithLogger

func WithLogger(logger echo.Logger) HotReloaderOption

func WithStaticFilePath

func WithStaticFilePath(path string) HotReloaderOption

func WithStaticRoute

func WithStaticRoute(route string) HotReloaderOption

func WithTemplatePathGlob

func WithTemplatePathGlob(path string) HotReloaderOption

type Logger

type Logger interface {
	Print(i ...interface{})
	Printf(format string, args ...interface{})
	Fatal(i ...interface{})
	Fatalf(format string, args ...interface{})
	Panic(i ...interface{})
	Panicf(format string, args ...interface{})
}

type UpdateMessage

type UpdateMessage struct {
	Path       string `json:"path"`
	AutoReload bool   `json:"autoReload"`
}

Jump to

Keyboard shortcuts

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