Documentation
¶
Overview ¶
Package planblob is the encoding of the opaque plan a pod stores and hands back on /v1/state: zstd over the plan's JSON, raw bytes on the wire. pkg/compression base64s its output, which the multipart part has no use for.
Both ends of the blob compile this package — the controller writes it, the controller and `haptic diff` read it back — so a pod's baseline is decoded by exactly one implementation.
Index ¶
- func Decode(blob []byte) (*renderplan.Plan, error)
- func DecodeCheckpoint(encoded, config string, files map[string]string) (*renderplan.Plan, error)
- func Encode(plan *renderplan.Plan) ([]byte, error)
- func EncodeCheckpoint(plan *renderplan.Plan) (string, error)
- func EncodeSnapshot(snapshot *renderplan.Snapshot) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Decode ¶
func Decode(blob []byte) (*renderplan.Plan, error)
Decode reads a blob back. The caller checks the plan id and schema version against what the pod reports: a plan that decodes is not yet a plan that describes this pod.
func DecodeCheckpoint ¶
DecodeCheckpoint restores exact bytes without parsing HAProxy configuration. The caller must bind the result to an authenticated renderoutput snapshot.
func Encode ¶
func Encode(plan *renderplan.Plan) ([]byte, error)
Encode produces the blob for one plan. It carries the plan id, so a decode can prove what it decoded.
func EncodeCheckpoint ¶
func EncodeCheckpoint(plan *renderplan.Plan) (string, error)
EncodeCheckpoint preserves declarations that cannot be recovered from file bytes.
func EncodeSnapshot ¶
func EncodeSnapshot(snapshot *renderplan.Snapshot) ([]byte, error)
EncodeSnapshot is Encode for the snapshot a render sealed: the same bytes, streamed from the fragments the snapshot already holds instead of a plan re-encoded from scratch on every deployment.
Types ¶
This section is empty.