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 .goflare/ 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 .goflare/)
OutputDir string // default: ".goflare/"
// 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