reloader

package
v0.0.0-...-3e579d5 Latest Latest
Warning

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

Go to latest
Published: May 29, 2024 License: BSD-3-Clause Imports: 18 Imported by: 0

Documentation

Overview

Package reloader is designed to be embedded into a hot reloadable executable.

This package watches a set of source code files and attempts to hot-reload changes to those files.

Index

Constants

View Source
const (
	PackageListEnv   = "GOT_RELOAD_PKGS"
	StartReloaderEnv = "GOT_RELOAD_START_RELOADER"
	SourceDirEnv     = "GOT_RELOAD_SOURCE_DIR"
)

Variables

View Source
var (

	// WatchedPkgs is the list of packages being watched for live reloading.
	// It is populated at init time from the process environment,
	// $GOT_RELOAD_PKGS.
	WatchedPkgs = watchPackages()
	// PkgsToDirs and DirsToPkgs provide convenient lookups between local
	// disk directories and go package names.
	PkgsToDirs, DirsToPkgs = watchDirs()

	RegisteredSymbols = interp.Exports{}
)

Functions

func Add

func Add() int

Add returns a value so that it can be used in a blank var expression, e.g.

var _ = Add()

This is used to make sure all the RegisterAll functions have run.

func RegisterAll

func RegisterAll(symbols interp.Exports)

RegisterAll invokes Register once for each symbol provided in the symbols map.

func Start

func Start()

func StartWatching

func StartWatching(list []string) (<-chan string, chan struct{}, *gotreload.Rewriter, error)

StartWatching returns a channel and a new gotreload.Rewriter. The channel emits a series of filenames (absolute paths) that've changed.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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