File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -178,6 +178,18 @@ type SourceRulesInfo struct {
178178	Rules    map [int64 ]RuleResp  // Rules is a map of rule IDs to their corresponding RuleResp objects. 
179179}
180180
181+ // Iter returns an iterator over the rules in the SourceRulesInfo. 
182+ // It yields each RuleResp object until all rules have been processed or the yield function returns false. 
183+ func  (r  * SourceRulesInfo ) Iter () iter.Seq [RuleResp ] {
184+ 	return  func (yield  func (RuleResp ) bool ) {
185+ 		for  _ , rule  :=  range  r .Rules  {
186+ 			if  ! yield (rule ) {
187+ 				break 
188+ 			}
189+ 		}
190+ 	}
191+ }
192+ 
181193// RuleResp represents a response object for a rule in the Icinga Notifications API. 
182194type  RuleResp  struct  {
183195	Id                int64   // Id is the unique identifier of the rule. 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments