MCPcopy Index your code
hub / github.com/rilldata/rill / projToDTO

Method projToDTO

admin/server/projects.go:2160–2188  ·  view source on GitHub ↗
(p *database.Project, orgName string)

Source from the content-addressed store, hash-verified

2158}
2159
2160func (s *Server) projToDTO(p *database.Project, orgName string) *adminv1.Project {
2161 return &adminv1.Project{
2162 Id: p.ID,
2163 Name: p.Name,
2164 OrgId: p.OrganizationID,
2165 OrgName: orgName,
2166 Description: p.Description,
2167 Public: p.Public,
2168 CreatedByUserId: safeStr(p.CreatedByUserID),
2169 DirectoryName: p.DirectoryName,
2170 Provisioner: p.Provisioner,
2171 ProdVersion: p.ProdVersion,
2172 ProdSlots: int64(p.ProdSlots),
2173 DevSlots: int64(p.DevSlots),
2174 PrimaryBranch: p.PrimaryBranch,
2175 Subpath: p.Subpath,
2176 GitRemote: safeStr(p.GitRemote),
2177 ManagedGitId: safeStr(p.ManagedGitRepoID),
2178 ArchiveAssetId: safeStr(p.ArchiveAssetID),
2179 PrimaryDeploymentId: safeStr(p.PrimaryDeploymentID),
2180 ProdTtlSeconds: safeInt64(p.ProdTTLSeconds),
2181 DevTtlSeconds: p.DevTTLSeconds,
2182 OverrideDiskGb: safeInt64(p.OverrideDiskGB),
2183 FrontendUrl: s.admin.URLs.Project(orgName, p.Name),
2184 Annotations: p.Annotations,
2185 CreatedOn: timestamppb.New(p.CreatedOn),
2186 UpdatedOn: timestamppb.New(p.UpdatedOn),
2187 }
2188}
2189
2190func (s *Server) hasAssetUsagePermission(ctx context.Context, id, orgID, ownerID string) bool {
2191 asset, err := s.admin.DB.FindAsset(ctx, id)

Callers 10

SudoGetResourceMethod · 0.95
GetProjectMethod · 0.95
GetProjectByIDMethod · 0.95
CreateProjectMethod · 0.95
UpdateProjectMethod · 0.95
SudoUpdateAnnotationsMethod · 0.95

Calls 3

safeStrFunction · 0.85
safeInt64Function · 0.85
ProjectMethod · 0.80

Tested by

no test coverage detected