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

Function GetProjectIDPlanID

backend/common/resource_name.go:232–242  ·  view source on GitHub ↗

GetProjectIDPlanID returns the project ID and plan ID from a resource name.

(name string)

Source from the content-addressed store, hash-verified

230
231// GetProjectIDPlanID returns the project ID and plan ID from a resource name.
232func GetProjectIDPlanID(name string) (string, int64, error) {
233 tokens, err := GetNameParentTokens(name, ProjectNamePrefix, PlanPrefix)
234 if err != nil {
235 return "", 0, err
236 }
237 planID, err := strconv.ParseInt(tokens[1], 10, 64)
238 if err != nil {
239 return "", 0, errors.Errorf("invalid plan ID %q", tokens[1])
240 }
241 return tokens[0], planID, nil
242}
243
244// GetProjectIDPlanIDPlanCheckRunID returns the project ID, plan ID and plan check run ID from a resource name.
245func GetProjectIDPlanIDPlanCheckRunID(name string) (string, int64, int64, error) {

Callers 13

listPlanUIDsFunction · 0.92
CreateRolloutMethod · 0.92
buildIssueMessageMethod · 0.92
GetPlanMethod · 0.92
UpdatePlanMethod · 0.92
RunPlanChecksMethod · 0.92

Calls 2

ErrorfMethod · 0.80
GetNameParentTokensFunction · 0.70

Tested by 1

listPlanUIDsFunction · 0.74