MCPcopy Create free account
hub / github.com/compozy/agh / Validate

Method Validate

internal/task/validate.go:738–758  ·  view source on GitHub ↗

Validate reports whether the audit event contains the canonical persisted shape.

()

Source from the content-addressed store, hash-verified

736
737// Validate reports whether the audit event contains the canonical persisted shape.
738func (e Event) Validate() error {
739 if strings.TrimSpace(e.ID) == "" {
740 return fmt.Errorf("%w: task_event.id is required", ErrValidation)
741 }
742 if strings.TrimSpace(e.TaskID) == "" {
743 return fmt.Errorf("%w: task_event.task_id is required", ErrValidation)
744 }
745 if strings.TrimSpace(e.EventType) == "" {
746 return fmt.Errorf("%w: task_event.event_type is required", ErrValidation)
747 }
748 if err := e.Actor.Validate("task_event.actor"); err != nil {
749 return err
750 }
751 if err := e.Origin.Validate("task_event.origin"); err != nil {
752 return err
753 }
754 if err := ValidatePayloadSize(e.Payload, "task_event.payload"); err != nil {
755 return err
756 }
757 return nil
758}
759
760// Validate reports whether the persisted idempotency record contains the canonical shape.
761func (r RunIdempotency) Validate() error {

Callers

nothing calls this directly

Calls 2

ValidatePayloadSizeFunction · 0.85
ValidateMethod · 0.65

Tested by

no test coverage detected