(name string)
| 478 | } |
| 479 | |
| 480 | func GetProjectReleaseIDFile(name string) (string, string, string, error) { |
| 481 | // Find the "files/" segment - everything after it is the encoded file path |
| 482 | parentPart, encodedFileID, found := strings.Cut(name, "/"+FileNamePrefix) |
| 483 | if !found { |
| 484 | return "", "", "", errors.Errorf("invalid release file name %q: missing files/ segment", name) |
| 485 | } |
| 486 | |
| 487 | tokens, err := GetNameParentTokens(parentPart, ProjectNamePrefix, ReleaseNamePrefix) |
| 488 | if err != nil { |
| 489 | return "", "", "", errors.Errorf("invalid release file name %q", name) |
| 490 | } |
| 491 | |
| 492 | fileID, err := url.PathUnescape(encodedFileID) |
| 493 | if err != nil { |
| 494 | return "", "", "", errors.Errorf("invalid release file name %q: failed to decode file ID", name) |
| 495 | } |
| 496 | |
| 497 | return tokens[0], tokens[1], fileID, nil |
| 498 | } |
| 499 | |
| 500 | // GetGroupEmail returns the group email. |
| 501 | func GetGroupEmail(name string) (string, error) { |
no test coverage detected