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

Function GetProjectIDWorksheetID

backend/common/resource_name.go:449–455  ·  view source on GitHub ↗

GetProjectIDWorksheetID returns the project ID and worksheet ID (resource_id) from a resource name. Format: projects/{project}/worksheets/{worksheet}

(name string)

Source from the content-addressed store, hash-verified

447// GetProjectIDWorksheetID returns the project ID and worksheet ID (resource_id) from a resource name.
448// Format: projects/{project}/worksheets/{worksheet}
449func GetProjectIDWorksheetID(name string) (string, string, error) {
450 tokens, err := GetNameParentTokens(name, ProjectNamePrefix, WorksheetIDPrefix)
451 if err != nil {
452 return "", "", err
453 }
454 return tokens[0], tokens[1], nil
455}
456
457// FormatWorksheet formats a worksheet resource name.
458// Format: projects/{project}/worksheets/{worksheet}

Callers 4

GetWorksheetMethod · 0.92
UpdateWorksheetMethod · 0.92
DeleteWorksheetMethod · 0.92

Calls 1

GetNameParentTokensFunction · 0.70

Tested by

no test coverage detected