validateAnnotationName performs a minimal client-side check on the annotation name (non-empty, within the length limit). The server enforces the full naming rules (allowed characters, reserved prefixes).
(name string)
| 46 | // name (non-empty, within the length limit). The server enforces the full |
| 47 | // naming rules (allowed characters, reserved prefixes). |
| 48 | func validateAnnotationName(name string) error { |
| 49 | if name == "" { |
| 50 | return errInvalidArgument("annotation name must not be empty") |
| 51 | } |
| 52 | if len(name) > maxAnnotationNameBytes { |
| 53 | return errInvalidArgument("annotation name exceeds 512 bytes") |
| 54 | } |
| 55 | return nil |
| 56 | } |
| 57 | |
| 58 | // PutObjectAnnotationOptions configures a PutObjectAnnotation request. |
| 59 | type PutObjectAnnotationOptions struct { |
no test coverage detected