Documentation
¶
Overview ¶
Package envelope provides versioned event wrappers with dual-read support for legacy bare JSON payloads.
Extracted from the Archon agent platform (https://github.com/diogoX451).
Index ¶
Constants ¶
View Source
const CurrentSchemaVersion = 1
CurrentSchemaVersion is the envelope version this package understands fully.
Variables ¶
This section is empty.
Functions ¶
func DecodePayload ¶
DecodePayload unmarshals env.Payload into dest.
func SupportedSchema ¶
SupportedSchema reports whether this binary can process the version.
Types ¶
type Envelope ¶
type Envelope struct {
SchemaVersion int `json:"schema_version"`
Type string `json:"type"`
TenantID string `json:"tenant_id,omitempty"`
CorrelationID string `json:"correlation_id,omitempty"`
WorkflowID string `json:"workflow_id,omitempty"`
OccurredAt time.Time `json:"occurred_at"`
Payload json.RawMessage `json:"payload"`
}
Envelope is the versioned wrapper for cross-process events and needs. Dual-read consumers: try UnmarshalFlexible; if no envelope fields, treat raw JSON as the payload itself (legacy).
Click to show internal directories.
Click to hide internal directories.