generatecmd

package
v0.2.590 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: MIT Imports: 33 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, w io.Writer, args Arguments) (err error)

Types

type Arguments added in v0.0.164

type Arguments struct {
	FileName                        string
	Path                            string
	Watch                           bool
	OpenBrowser                     bool
	Command                         string
	ProxyPort                       int
	Proxy                           string
	WorkerCount                     int
	GenerateSourceMapVisualisations bool
	IncludeVersion                  bool
	IncludeTimestamp                bool
	LogLevel                        string
	// PPROFPort is the port to run the pprof server on.
	PPROFPort         int
	KeepOrphanedFiles bool
}

type FSEventHandler added in v0.2.590

type FSEventHandler struct {
	Log *slog.Logger

	DevMode bool
	Errors  []error
	// contains filtered or unexported fields
}

func NewFSEventHandler added in v0.2.590

func NewFSEventHandler(log *slog.Logger, dir string, devMode bool, genOpts []generator.GenerateOpt, genSourceMapVis bool, keepOrphanedFiles bool) *FSEventHandler

func (*FSEventHandler) HandleEvent added in v0.2.590

func (h *FSEventHandler) HandleEvent(ctx context.Context, event fsnotify.Event) (goUpdated, textUpdated bool, err error)

func (*FSEventHandler) SetError added in v0.2.590

func (h *FSEventHandler) SetError(fileName string, hasError bool) (previouslyHadError bool, errorCount int)

func (*FSEventHandler) UpsertHash added in v0.2.590

func (h *FSEventHandler) UpsertHash(fileName string, hash [sha256.Size]byte) (updated bool)

func (*FSEventHandler) UpsertLastModTime added in v0.2.590

func (h *FSEventHandler) UpsertLastModTime(fileName string) (updated bool)

type FatalError added in v0.2.590

type FatalError struct {
	Err error
}

func (FatalError) As added in v0.2.590

func (e FatalError) As(target interface{}) bool

func (FatalError) Error added in v0.2.590

func (e FatalError) Error() string

func (FatalError) Is added in v0.2.590

func (e FatalError) Is(target error) bool

func (FatalError) Unwrap added in v0.2.590

func (e FatalError) Unwrap() error

type Generate added in v0.2.590

type Generate struct {
	Log  *slog.Logger
	Args *Arguments
}

func NewGenerate added in v0.2.590

func NewGenerate(log *slog.Logger, args Arguments) (g *Generate)

func (Generate) Run added in v0.2.590

func (cmd Generate) Run(ctx context.Context) (err error)

func (*Generate) StartProxy added in v0.2.590

func (cmd *Generate) StartProxy(ctx context.Context) (p *proxy.Handler, err error)

type GenerationEvent added in v0.2.590

type GenerationEvent struct {
	Event       fsnotify.Event
	GoUpdated   bool
	TextUpdated bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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