ValidateUUID that the payload is a UUID
(ID string, name string)
| 164 | |
| 165 | // ValidateUUID that the payload is a UUID |
| 166 | func (validator *validator) ValidateUUID(ID string, name string) url.Values { |
| 167 | request := map[string]string{ |
| 168 | name: ID, |
| 169 | } |
| 170 | |
| 171 | v := govalidator.New(govalidator.Options{ |
| 172 | Data: &request, |
| 173 | Rules: govalidator.MapData{ |
| 174 | name: []string{ |
| 175 | "required", |
| 176 | "uuid", |
| 177 | }, |
| 178 | }, |
| 179 | }) |
| 180 | |
| 181 | return v.ValidateStruct() |
| 182 | } |
| 183 | |
| 184 | func validateAttachmentURL(ctx context.Context, c cache.Cache, attachmentURL string) error { |
| 185 | cacheKey := "mms-url-validation:" + attachmentURL |