Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewGalaHeadersFromMutationMetadata ¶
func NewGalaHeadersFromMutationMetadata(metadata MutationGalaMetadata) gala.Headers
NewGalaHeadersFromMutationMetadata builds Gala headers from mutation metadata.
func NewMutationGalaEnvelope ¶
func NewMutationGalaEnvelope(ctx context.Context, g galaEnvelopeRuntime, topic gala.Topic[MutationGalaPayload], payload *events.MutationPayload, metadata MutationGalaMetadata) (envelope gala.Envelope, err error)
NewMutationGalaEnvelope builds a gala envelope from legacy mutation emit inputs.
Types ¶
type MutationGalaMetadata ¶
type MutationGalaMetadata struct {
// EventID is the stable idempotency/event identifier for this mutation dispatch.
EventID string
// Properties stores string-safe metadata for listener header fallbacks.
Properties map[string]string
}
MutationGalaMetadata captures envelope metadata for Gala mutation dispatch.
func NewMutationGalaMetadata ¶
func NewMutationGalaMetadata(eventID string, payload *events.MutationPayload) MutationGalaMetadata
NewMutationGalaMetadata builds metadata for Gala mutation envelopes from mutation payload data.
type MutationGalaPayload ¶
type MutationGalaPayload struct {
// MutationType is the ent schema type that emitted the mutation.
MutationType string `json:"mutation_type"`
// Operation is the mutation operation string.
Operation string `json:"operation"`
// EntityID is the mutated entity identifier.
EntityID string `json:"entity_id"`
// ChangedFields captures updated/cleared fields for the mutation.
ChangedFields []string `json:"changed_fields,omitempty"`
// ClearedFields captures fields explicitly cleared by the mutation.
ClearedFields []string `json:"cleared_fields,omitempty"`
// ChangedEdges captures changed edge names for workflow-eligible edges.
ChangedEdges []string `json:"changed_edges,omitempty"`
// AddedIDs captures edge IDs added by edge name.
AddedIDs map[string][]string `json:"added_ids,omitempty"`
// RemovedIDs captures edge IDs removed by edge name.
RemovedIDs map[string][]string `json:"removed_ids,omitempty"`
// ProposedChanges captures field-level proposed values.
ProposedChanges map[string]any `json:"proposed_changes,omitempty"`
}
MutationGalaPayload is the JSON-safe mutation payload contract for gala.
func NewMutationGalaPayload ¶
func NewMutationGalaPayload(payload *events.MutationPayload) MutationGalaPayload
NewMutationGalaPayload converts a mutation payload into a JSON-safe gala payload.
Click to show internal directories.
Click to hide internal directories.