MCPcopy Index your code
hub / github.com/bytebase/bytebase / GetProjectID

Function GetProjectID

backend/common/resource_name.go:72–78  ·  view source on GitHub ↗

GetProjectID returns the project ID from a resource name.

(name string)

Source from the content-addressed store, hash-verified

70
71// GetProjectID returns the project ID from a resource name.
72func GetProjectID(name string) (string, error) {
73 tokens, err := GetNameParentTokens(name, ProjectNamePrefix)
74 if err != nil {
75 return "", err
76 }
77 return tokens[0], nil
78}
79
80// GetProjectIDDatabaseGroupID returns the project ID and database group ID from a resource name.
81func GetProjectIDDatabaseGroupID(name string) (string, string, error) {

Callers 15

GetListDatabaseFilterFunction · 0.92
GetListGroupFilterFunction · 0.92
GetListInstanceFilterFunction · 0.92
GetAccountListFilterFunction · 0.92
CreateDatabaseGroupMethod · 0.92
ListDatabaseGroupsMethod · 0.92
CreateSheetMethod · 0.92
BatchCreateSheetsMethod · 0.92
ListRolloutsMethod · 0.92

Calls 1

GetNameParentTokensFunction · 0.70

Tested by

no test coverage detected