watch

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2023 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Overview

Package watch contains the watch.Execute function called by the main command line interface

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute(settings *execute.ProcessSettings) <-chan ReturnData

Execute processes all files in the InputPath directory.

It continually watches the directory for relevant changes in its own goroutine, and only processes and updates the necessary files when a change is detected.

Types

type ReturnData

type ReturnData struct {
	Type    ReturnType
	Files   execute.ProcessedFileList //Only on ReturnType=WR_ProcessedDirectory
	Err     error                     //Only on ReturnType=WR_ProcessedDirectory or WR_ProcessedFile or WR_ErroredOut
	Message string                    //Only on ReturnType=WR_Message or WR_ProcessedFile
}

ReturnData is the data that is returned through a channel from watch.Execute when it processes files

type ReturnType

type ReturnType int
const (
	WR_Message            ReturnType = iota //An informative message is being sent
	WR_ProcessedDirectory                   //Directory() was called due to initialization or default language update
	WR_ProcessedFile                        //A single file was updated. Message contains the filename. Error is filled on error.
	WR_ErroredOut                           //The watch could not be started or has closed
	WR_CloseRequested                       //Process close was requested
)

Jump to

Keyboard shortcuts

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