add variable and method comments
This commit is contained in:
@@ -11,6 +11,7 @@ import (
|
||||
|
||||
const organizationEvent = "metalorganization"
|
||||
|
||||
// buildOrganizationRelationships compiles all relations into a relationships object to be processed by the processors.
|
||||
func (s *service) buildOrganizationRelationships(org *models.OrganizationDetails) (Relationships, error) {
|
||||
relations := Relationships{
|
||||
Resource: org,
|
||||
@@ -46,6 +47,7 @@ func (s *service) buildOrganizationRelationships(org *models.OrganizationDetails
|
||||
return relations, nil
|
||||
}
|
||||
|
||||
// IsOrganizationID checks if the provided id has the metal organization prefix.
|
||||
func (s *service) IsOrganizationID(id gidx.PrefixedID) bool {
|
||||
if idType, ok := s.idPrefixMap[id.Prefix()]; ok {
|
||||
return idType == TypeOrganization
|
||||
@@ -54,6 +56,7 @@ func (s *service) IsOrganizationID(id gidx.PrefixedID) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// TouchOrganization initializes a sync for the provided organization id for relationships and memberships.
|
||||
func (s *service) TouchOrganization(ctx context.Context, id gidx.PrefixedID) error {
|
||||
logger := s.logger.With("organization.id", id.String())
|
||||
|
||||
@@ -84,6 +87,7 @@ func (s *service) TouchOrganization(ctx context.Context, id gidx.PrefixedID) err
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeleteOrganization deletes the provided organization id.
|
||||
func (s *service) DeleteOrganization(ctx context.Context, id gidx.PrefixedID) error {
|
||||
err := s.publisher.PublishChange(ctx, organizationEvent, events.ChangeMessage{
|
||||
SubjectID: id,
|
||||
|
||||
Reference in New Issue
Block a user