Documentation
¶
Index ¶
- type Config
- type Goflare
- func (h *Goflare) Change(newValue string, progress func(msgs ...any))
- func (g *Goflare) GeneratePagesFiles() error
- func (g *Goflare) GenerateWorkerFiles() error
- func (h *Goflare) Label() string
- func (g *Goflare) Logger(messages ...any)
- func (h *Goflare) MainInputFileRelativePath() string
- func (h *Goflare) Name() string
- func (h *Goflare) NewFileEvent(fileName, extension, filePath, event string) error
- func (g *Goflare) SetCompilerMode(newValue string)
- func (g *Goflare) SetLog(f func(message ...any))
- func (h *Goflare) Shortcuts() []map[string]string
- func (h *Goflare) SupportedExtensions() []string
- func (h *Goflare) UnobservedFiles() []string
- func (h *Goflare) Value() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
AppRootDir string // default: "."
RelativeInputDirectory func() string // input relative directory for source code server app.go to deploy app.wasm (relative) default: "web"
RelativeOutputDirectory func() string // output relative directory for worker.js and app.wasm file (relative) default: "deploy/cloudflare"
MainInputFile string // eg: "main.go"
CompilingArguments func() []string
OutputWasmFileName string // WASM file name (default: "worker.wasm")
BuildPageFunctionShortcut string // build assets wasm,js, json files to pages functions (default: "f")
BuildWorkerShortcut string // build assets wasm,js, json files to workers (default: "w")
}
func DefaultConfig ¶
func DefaultConfig() *Config
DefaultConfig returns a Config with all default values set AppRootDir=".", RelativeInputDirectory="web", RelativeOutputDirectory="deploy/cloudflare", MainInputFile="main.worker.go", OutputWasmFileName="worker.wasm"
type Goflare ¶
type Goflare struct {
// contains filtered or unexported fields
}
func New ¶
New creates a new Goflare instance with the provided configuration Timeout is set to 40 seconds maximum as TinyGo compilation can be slow Default values: AppRootDir=".", RelativeOutputDirectory="deploy/cloudflare", MainInputFile="main.worker.go", OutputWasmFileName="app.wasm"
func (*Goflare) GeneratePagesFiles ¶
GeneratePagesFiles generates all necessary files for Cloudflare Pages Functions using Advanced Mode generates the _worker.js file for Pages (Advanced Mode) https://developers.cloudflare.com/pages/functions/advanced-mode/ This creates a single combined file with wasm_exec.js and runtime.mjs inline
func (*Goflare) GenerateWorkerFiles ¶
func (*Goflare) MainInputFileRelativePath ¶
MainInputFileRelativePath returns the relative path to the main input file This is used by devwatch to determine file ownership for Go files
func (*Goflare) NewFileEvent ¶
NewFileEvent handles file change events for goflare This method is called by devwatch when a relevant file changes
func (*Goflare) SetCompilerMode ¶
SetCompilerMode changes the compiler mode mode: "L" (Large fast/Go), "M" (Medium TinyGo debug), "S" (Small TinyGo production)
func (*Goflare) SupportedExtensions ¶
SupportedExtensions returns the file extensions that goflare monitors For edge workers, we primarily watch .go files
func (*Goflare) UnobservedFiles ¶
UnobservedFiles returns files that should be ignored by the file watcher These are output files generated by goflare that shouldn't trigger recompilation