Documentation
¶
Index ¶
- func RunBuild(envPath string, out io.Writer) error
- func RunDeploy(envPath string, in io.Reader, out io.Writer) error
- func RunInit(envPath string, in io.Reader, out io.Writer) error
- func UpdateGitignore(dir string) error
- func Usage() string
- func WriteEnvFile(cfg *Config, path string) error
- type Config
- type DeployResult
- type Goflare
- func (g *Goflare) Auth(store Store, in io.Reader) error
- func (g *Goflare) Build() error
- func (h *Goflare) Change(newValue string, progress func(msgs ...any))
- func (g *Goflare) Deploy(store Store) error
- func (g *Goflare) DeployPages(store Store) error
- func (g *Goflare) DeployWorker(store Store) error
- func (g *Goflare) GeneratePagesFiles() error
- func (g *Goflare) GenerateWorkerFiles() error
- func (g *Goflare) GetToken(store Store) (string, 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
- func (g *Goflare) WriteSummary(out io.Writer, results []DeployResult)
- type KeyringStore
- type MemoryStore
- type Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func UpdateGitignore ¶ added in v0.1.0
UpdateGitignore reads .gitignore in dir. Appends .env and .build/ if not already present. Creates .gitignore if it does not exist.
func WriteEnvFile ¶ added in v0.1.0
WriteEnvFile writes a .env file with all non-empty fields.
Types ¶
type Config ¶
type Config struct {
// Project identity
ProjectName string // PROJECT_NAME
AccountID string // CLOUDFLARE_ACCOUNT_ID
WorkerName string // WORKER_NAME (default: ProjectName + "-worker")
// Routing
Domain string // DOMAIN (optional — custom domain for Pages)
// Build inputs
Entry string // ENTRY (path to main Go file, empty = Pages only)
PublicDir string // PUBLIC_DIR (path to static assets, empty = Worker only)
// Build output (not in .env — always .build/)
OutputDir string // default: ".build/"
// Compiler
CompilerMode string // "S" | "M" | "L" default: "S"
}
func LoadConfigFromEnv ¶ added in v0.1.0
LoadConfigFromEnv reads a .env file and populates Config. Falls back to OS environment variables if .env path is empty or does not exist. Applies defaults after loading.
type DeployResult ¶ added in v0.1.0
DeployResult represents the result of a deployment to a target.
type Goflare ¶
type Goflare struct {
Config *Config // exported so CLI can read it after LoadConfigFromEnv
BaseURL string
// contains filtered or unexported fields
}
func (*Goflare) Auth ¶ added in v0.0.97
Auth implements token validation and keyring storage as a method.
func (*Goflare) DeployPages ¶ added in v0.0.97
DeployPages uploads the Pages build output (from config.OutputDir) to Cloudflare Pages.
func (*Goflare) DeployWorker ¶ added in v0.0.99
DeployWorker uploads the Worker build output to Cloudflare Workers.
func (*Goflare) GeneratePagesFiles ¶
func (*Goflare) GenerateWorkerFiles ¶
func (*Goflare) GetToken ¶ added in v0.1.0
GetToken reads the token from the store without prompting.
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
func (*Goflare) WriteSummary ¶ added in v0.1.0
func (g *Goflare) WriteSummary(out io.Writer, results []DeployResult)
WriteSummary formats and writes the deploy summary to out.
type KeyringStore ¶ added in v0.1.0
type KeyringStore struct {
ProjectName string
}
KeyringStore is the real implementation using go-keyring.
func NewKeyringStore ¶ added in v0.1.0
func NewKeyringStore() *KeyringStore
func (*KeyringStore) Set ¶ added in v0.1.0
func (s *KeyringStore) Set(key, value string) error
type MemoryStore ¶ added in v0.1.0
type MemoryStore struct {
// contains filtered or unexported fields
}
MemoryStore is an in-memory Store exported for use by library consumers in tests. Safe for concurrent use.
func NewMemoryStore ¶ added in v0.1.0
func NewMemoryStore() *MemoryStore
func (*MemoryStore) Set ¶ added in v0.1.0
func (s *MemoryStore) Set(key, value string) error