add variable and method comments
This commit is contained in:
@@ -11,6 +11,7 @@ import (
|
||||
|
||||
const projectEvent = "metalproject"
|
||||
|
||||
// buildProjectRelationships compiles all relations into a relationships object to be processed by the processors.
|
||||
func (s *service) buildProjectRelationships(project *models.ProjectDetails) (Relationships, error) {
|
||||
relations := Relationships{
|
||||
Resource: project,
|
||||
@@ -39,6 +40,7 @@ func (s *service) buildProjectRelationships(project *models.ProjectDetails) (Rel
|
||||
return relations, nil
|
||||
}
|
||||
|
||||
// IsProjectID checks if the provided id has the metal project prefix.
|
||||
func (s *service) IsProjectID(id gidx.PrefixedID) bool {
|
||||
if idType, ok := s.idPrefixMap[id.Prefix()]; ok {
|
||||
return idType == TypeProject
|
||||
@@ -47,6 +49,7 @@ func (s *service) IsProjectID(id gidx.PrefixedID) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// TouchProject initializes a sync for the provided project id for relationships and memberships.
|
||||
func (s *service) TouchProject(ctx context.Context, id gidx.PrefixedID) error {
|
||||
logger := s.logger.With("project.id", id.String())
|
||||
|
||||
@@ -77,6 +80,7 @@ func (s *service) TouchProject(ctx context.Context, id gidx.PrefixedID) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeleteProject deletes the provided project id.
|
||||
func (s *service) DeleteProject(ctx context.Context, id gidx.PrefixedID) error {
|
||||
err := s.publisher.PublishChange(ctx, projectEvent, events.ChangeMessage{
|
||||
SubjectID: id,
|
||||
|
||||
Reference in New Issue
Block a user