fluid-core/internal/contract/event_gen.go

49 lines
2.2 KiB
Go
Raw Normal View History

// Code generated by tools/schemagen. DO NOT EDIT.
// Source: schemas/. Regenerate with `make generate`.
package contract
type FluidEventEntityType string
const (
FluidEventEntityTypePressure FluidEventEntityType = "pressure"
FluidEventEntityTypeHypothesis FluidEventEntityType = "hypothesis"
FluidEventEntityTypeRevision FluidEventEntityType = "revision"
FluidEventEntityTypeExperiment FluidEventEntityType = "experiment"
FluidEventEntityTypeBackendRequirement FluidEventEntityType = "backend_requirement"
FluidEventEntityTypeIntent FluidEventEntityType = "intent"
FluidEventEntityTypeDecision FluidEventEntityType = "decision"
FluidEventEntityTypeRoutingPolicy FluidEventEntityType = "routing_policy"
)
// Valid reports whether v is a defined FluidEventEntityType.
func (v FluidEventEntityType) Valid() bool {
switch v {
case FluidEventEntityTypePressure, FluidEventEntityTypeHypothesis, FluidEventEntityTypeRevision, FluidEventEntityTypeExperiment, FluidEventEntityTypeBackendRequirement, FluidEventEntityTypeIntent, FluidEventEntityTypeDecision, FluidEventEntityTypeRoutingPolicy:
return true
}
return false
}
type FluidEvent struct {
Actor Actor `json:"actor" yaml:"actor"`
EntityID string `json:"entity_id" yaml:"entity_id"`
EntityType FluidEventEntityType `json:"entity_type" yaml:"entity_type"`
EventType string `json:"event_type" yaml:"event_type"`
EvidenceRefs []EvidenceRef `json:"evidence_refs,omitempty" yaml:"evidence_refs,omitempty"`
ID EventID `json:"id" yaml:"id"`
// Identifiers of the records this transition drew on.
Inputs []string `json:"inputs,omitempty" yaml:"inputs,omitempty"`
OccurredAt Timestamp `json:"occurred_at" yaml:"occurred_at"`
Reason string `json:"reason,omitempty" yaml:"reason,omitempty"`
SchemaVersion SchemaVersion `json:"schema_version" yaml:"schema_version"`
}
// Append-only record of a material lifecycle transition. FLUID evolution is itself
// a system behavior that must remain reconstructable
// (FluidHypothesisRevisionSchema.md section 15).
type EventDocument struct {
FluidEvent FluidEvent `json:"fluid_event" yaml:"fluid_event"`
}