Documentation
¶
Index ¶
- type CompileCallback
- type Config
- type GoBuild
- func (h *GoBuild) BuildArguments() []string
- func (h *GoBuild) Cancel() error
- func (h *GoBuild) CompileProgram() error
- func (h *GoBuild) IsCompiling() bool
- func (h *GoBuild) MainInputFileRelativePath() string
- func (h *GoBuild) MainOutputFileNameWithExtension() string
- func (h *GoBuild) RenameOutputFile() error
- func (h *GoBuild) RenameOutputFileFrom(tempFileName string) error
- func (h *GoBuild) UnobservedFiles() []string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CompileCallback ¶
type CompileCallback func(error)
CompileCallback is called when compilation completes (success or failure)
type Config ¶
type Config struct {
Command string // eg: "go", "tinygo"
MainInputFileRelativePath string // eg: web/main.server.go, web/main.wasm.go
OutName string // eg: app, user, main.server
Extension string // eg: .exe, .wasm
CompilingArguments func() []string // eg: []string{"-X 'main.version=v1.0.0'"}
OutFolderRelativePath string // eg: web, web/public/wasm
Logger func(message ...any) // output for log messages to integrate with other tools (e.g., TUI)
Callback CompileCallback // optional callback for async compilation
Timeout time.Duration // max compilation time, defaults to 5 seconds if not set
Env []string // environment variables, eg: []string{"GOOS=js", "GOARCH=wasm"}
}
Config holds the configuration for Go compilation
type GoBuild ¶
type GoBuild struct {
// contains filtered or unexported fields
}
GoBuild represents a Go compiler instance
func (*GoBuild) BuildArguments ¶ added in v0.0.3
BuildArguments returns the build arguments that would be used for compilation This is exposed for testing purposes
func (*GoBuild) CompileProgram ¶
CompileProgram compiles the Go program If a callback is configured, it runs asynchronously and returns immediately Otherwise, it runs synchronously and returns the compilation result Thread-safe: cancels any previous compilation automatically
func (*GoBuild) IsCompiling ¶ added in v0.0.3
IsCompiling returns true if there's an active compilation
func (*GoBuild) MainInputFileRelativePath ¶ added in v0.0.11
MainInputFileRelativePath eg: cmd/main.go
func (*GoBuild) MainOutputFileNameWithExtension ¶ added in v0.0.3
MainOutputFileNameWithExtension returns the output filename with extension (e.g., "main.wasm", "app.exe")
func (*GoBuild) RenameOutputFile ¶ added in v0.0.3
RenameOutputFile renames the default temporary output file to the final output file This is exposed for testing purposes
func (*GoBuild) RenameOutputFileFrom ¶ added in v0.0.3
RenameOutputFileFrom renames a specific temporary file to the final output file This is exposed for testing purposes
func (*GoBuild) UnobservedFiles ¶
UnobservedFiles returns the list of files that should not be tracked by file watchers eg: main.exe, main_temp.exe