Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FileWriter ¶
Types ¶
type ArgumentError ¶
type ArgumentError struct {
Message string
}
func (*ArgumentError) Code ¶
func (a *ArgumentError) Code() int
func (*ArgumentError) Error ¶
func (e *ArgumentError) Error() string
type Arguments ¶
type Arguments struct {
FileName string
FileWriter FileWriterFunc
Path string
Check bool
Watch bool
WatchPattern *regexp.Regexp
IgnorePattern *regexp.Regexp
OpenBrowser bool
Command string
ProxyBind string
ProxyPort int
Proxy string
ProxyTLSCrt string
ProxyTLSKey string
NotifyProxy bool
WorkerCount int
GenerateSourceMapVisualisations bool
IncludeVersion bool
IncludeTimestamp bool
// PPROFPort is the port to run the pprof server on.
PPROFPort int
KeepOrphanedFiles bool
Lazy bool
}
type FSEventHandler ¶
type FSEventHandler struct {
Log *slog.Logger
Errors []error
// contains filtered or unexported fields
}
func NewFSEventHandler ¶
func NewFSEventHandler( log *slog.Logger, dir string, devMode bool, genOpts []generator.GenerateOpt, genSourceMapVis bool, keepOrphanedFiles bool, fileWriter FileWriterFunc, lazy bool, ) *FSEventHandler
func (*FSEventHandler) HandleEvent ¶
func (h *FSEventHandler) HandleEvent(ctx context.Context, event fsnotify.Event) (result GenerateResult, err error)
type FatalError ¶
type FatalError struct {
Err error
}
func (FatalError) As ¶
func (e FatalError) As(target any) bool
func (FatalError) Error ¶
func (e FatalError) Error() string
func (FatalError) Is ¶
func (e FatalError) Is(target error) bool
func (FatalError) Unwrap ¶
func (e FatalError) Unwrap() error
type FileWriterFunc ¶
func NewCheckWriter ¶
func NewCheckWriter() (writer FileWriterFunc, getChanged func() []string)
NewCheckWriter returns a FileWriterFunc that compares generated output against existing files without writing, and a function to retrieve the list of files that differ.
func WriterFileWriter ¶
func WriterFileWriter(w io.Writer) FileWriterFunc
type GenerateResult ¶
type GenerateResult struct {
// GoFileWritten indicates that the generated Go file was written because its content changed.
GoFileWritten bool
// WatchedFileUpdated indicates that a file matching the watch pattern was updated.
WatchedFileUpdated bool
// TemplFileTextUpdated indicates that text literals were updated.
TemplFileTextUpdated bool
// TemplFileGoUpdated indicates that Go expressions were updated.
TemplFileGoUpdated bool
}
Click to show internal directories.
Click to hide internal directories.