ValidateHasPayload checks if the function has a payload. Returns an error if the payload is empty.
()
| 112 | // ValidateHasPayload checks if the function has a payload. |
| 113 | // Returns an error if the payload is empty. |
| 114 | func (f Function) ValidateHasPayload() error { |
| 115 | if !f.HasPayload() { |
| 116 | return fmt.Errorf("missing configuration payload") |
| 117 | } |
| 118 | return nil |
| 119 | } |
| 120 | |
| 121 | // UnmarshalPayload unmarshals the payload into dst based on ContentType. |
| 122 | // Uses JSON for "application/json", YAML otherwise. |