MCPcopy Create free account
hub / github.com/bytebase/bytebase / GetProjectIDIssueUIDIssueCommentID

Function GetProjectIDIssueUIDIssueCommentID

backend/common/resource_name.go:219–229  ·  view source on GitHub ↗

GetProjectIDIssueUIDIssueCommentID returns the project ID, issue UID and issue comment ID from the issue comment name.

(name string)

Source from the content-addressed store, hash-verified

217
218// GetProjectIDIssueUIDIssueCommentID returns the project ID, issue UID and issue comment ID from the issue comment name.
219func GetProjectIDIssueUIDIssueCommentID(name string) (string, int64, string, error) {
220 tokens, err := GetNameParentTokens(name, ProjectNamePrefix, IssueNamePrefix, IssueCommentNamePrefix)
221 if err != nil {
222 return "", 0, "", err
223 }
224 issueUID, err := strconv.ParseInt(tokens[1], 10, 64)
225 if err != nil {
226 return "", 0, "", errors.Errorf("invalid issue ID %q", tokens[1])
227 }
228 return tokens[0], issueUID, tokens[2], nil
229}
230
231// GetProjectIDPlanID returns the project ID and plan ID from a resource name.
232func GetProjectIDPlanID(name string) (string, int64, error) {

Callers 1

UpdateIssueCommentMethod · 0.92

Calls 2

ErrorfMethod · 0.80
GetNameParentTokensFunction · 0.70

Tested by

no test coverage detected