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

Function buildRoleName

backend/api/v1/instance_service_converter.go:38–46  ·  view source on GitHub ↗

buildRoleName builds the role name with the given instance ID and role name.

(b *strings.Builder, instanceID, roleName string)

Source from the content-addressed store, hash-verified

36
37// buildRoleName builds the role name with the given instance ID and role name.
38func buildRoleName(b *strings.Builder, instanceID, roleName string) string {
39 b.Reset()
40 _, _ = b.WriteString(common.InstanceNamePrefix)
41 _, _ = b.WriteString(instanceID)
42 _, _ = b.WriteString("/")
43 _, _ = b.WriteString(common.RolePrefix)
44 _, _ = b.WriteString(roleName)
45 return b.String()
46}
47
48func convertInstanceRoles(instance *store.InstanceMessage, roles []*storepb.InstanceRole) []*v1pb.InstanceRole {
49 var v1Roles []*v1pb.InstanceRole

Callers 1

convertInstanceRolesFunction · 0.85

Calls 2

StringMethod · 0.65
ResetMethod · 0.45

Tested by

no test coverage detected