Documentation
¶
Overview ¶
Package cfstate is the persistent, encrypted record of the Cloudflare resources NextDeploy has provisioned (D1, KV, Hyperdrive, Queues, Vectorize, …) keyed by kind+name → real CF ID.
Why it exists: name-based `ensure*` already prevents duplicate creation, but a manifest lets the engine (a) skip live `list` round-trips on re-runs and (b) detect orphans — resources it recorded but the user no longer declares in nextdeploy.yml. The file is AES-256-GCM encrypted (the resource graph of an account is sensitive metadata) and written 0600.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Manifest ¶
type Manifest struct {
Version int `json:"version"`
Resources map[string]Record `json:"resources"`
}
Manifest maps "kind:name" → Record.
func Load ¶
Load reads + decrypts the manifest. A missing file yields a fresh (empty) manifest, not an error — first run is normal. A decrypt failure (wrong key or corruption) IS an error so a split-brain isn't silently masked.
type Record ¶
type Record struct {
Kind string `json:"kind"` // d1, kv, hyperdrive, queue, vectorize, ai_gateway
Name string `json:"name"` // declared name
ID string `json:"id"` // CF resource UUID / identifier
UpdatedAt string `json:"updated_at"` // RFC3339, stamped by the caller
}
Record is one provisioned Cloudflare resource.