github.com/kyma-incubator/compass/components/director@v0.0.0-20230623144113-d764f56ff805/pkg/formationconstraint/join_point_location.go (about)

     1  package formationconstraint
     2  
     3  import "github.com/kyma-incubator/compass/components/director/internal/model"
     4  
     5  // JoinPointLocation contains information to distinguish join points
     6  type JoinPointLocation struct {
     7  	OperationName  model.TargetOperation
     8  	ConstraintType model.FormationConstraintType
     9  }
    10  
    11  var (
    12  	// PreAssign represents the location before AssignFormation operation execution
    13  	PreAssign = JoinPointLocation{
    14  		OperationName:  model.AssignFormationOperation,
    15  		ConstraintType: model.PreOperation,
    16  	}
    17  	// PostAssign represents the location after AssignFormation operation execution
    18  	PostAssign = JoinPointLocation{
    19  		OperationName:  model.AssignFormationOperation,
    20  		ConstraintType: model.PostOperation,
    21  	}
    22  	// PreUnassign represents the location before UnassignFormation operation execution
    23  	PreUnassign = JoinPointLocation{
    24  		OperationName:  model.UnassignFormationOperation,
    25  		ConstraintType: model.PreOperation,
    26  	}
    27  	// PostUnassign represents the location after UnassignFormation operation execution
    28  	PostUnassign = JoinPointLocation{
    29  		OperationName:  model.UnassignFormationOperation,
    30  		ConstraintType: model.PostOperation,
    31  	}
    32  	// PreCreate represents the location before CreateFormation operation execution
    33  	PreCreate = JoinPointLocation{
    34  		OperationName:  model.CreateFormationOperation,
    35  		ConstraintType: model.PreOperation,
    36  	}
    37  	// PostCreate represents the location after CreateFormation operation execution
    38  	PostCreate = JoinPointLocation{
    39  		OperationName:  model.CreateFormationOperation,
    40  		ConstraintType: model.PostOperation,
    41  	}
    42  	// PreDelete represents the location before DeleteFormation operation execution
    43  	PreDelete = JoinPointLocation{
    44  		OperationName:  model.DeleteFormationOperation,
    45  		ConstraintType: model.PreOperation,
    46  	}
    47  	// PostDelete represents the location after DeleteFormation operation execution
    48  	PostDelete = JoinPointLocation{
    49  		OperationName:  model.DeleteFormationOperation,
    50  		ConstraintType: model.PostOperation,
    51  	}
    52  	// PreGenerateFormationAssignmentNotifications represents the location before GenerateFormationAssignmentNotifications operation execution
    53  	PreGenerateFormationAssignmentNotifications = JoinPointLocation{
    54  		OperationName:  model.GenerateFormationAssignmentNotificationOperation,
    55  		ConstraintType: model.PreOperation,
    56  	}
    57  	// PostGenerateFormationAssignmentNotifications represents the location after GenerateFormationAssignmentNotifications operation execution
    58  	PostGenerateFormationAssignmentNotifications = JoinPointLocation{
    59  		OperationName:  model.GenerateFormationAssignmentNotificationOperation,
    60  		ConstraintType: model.PostOperation,
    61  	}
    62  	// PreGenerateFormationNotifications represents the location before GenerateFormationNotifications operation execution
    63  	PreGenerateFormationNotifications = JoinPointLocation{
    64  		OperationName:  model.GenerateFormationNotificationOperation,
    65  		ConstraintType: model.PreOperation,
    66  	}
    67  	// PostGenerateFormationNotifications represents the location after GenerateFormationNotifications operation execution
    68  	PostGenerateFormationNotifications = JoinPointLocation{
    69  		OperationName:  model.GenerateFormationNotificationOperation,
    70  		ConstraintType: model.PostOperation,
    71  	}
    72  	// PreSendNotification represents the location before SendNotification operation execution
    73  	PreSendNotification = JoinPointLocation{
    74  		OperationName:  model.SendNotificationOperation,
    75  		ConstraintType: model.PreOperation,
    76  	}
    77  	// PostSendNotification represents the location after SendNotification operation execution
    78  	PostSendNotification = JoinPointLocation{
    79  		OperationName:  model.SendNotificationOperation,
    80  		ConstraintType: model.PostOperation,
    81  	}
    82  	// PreNotificationStatusReturned represents the location before NotificationStatusReturned operation execution
    83  	PreNotificationStatusReturned = JoinPointLocation{
    84  		OperationName:  model.NotificationStatusReturned,
    85  		ConstraintType: model.PreOperation,
    86  	}
    87  	// PostNotificationStatusReturned represents the location after NotificationStatusReturned operation execution
    88  	PostNotificationStatusReturned = JoinPointLocation{
    89  		OperationName:  model.NotificationStatusReturned,
    90  		ConstraintType: model.PostOperation,
    91  	}
    92  )