Modified PostRecords function to return number of records posted

master
Sean Murphy 6 years ago
parent 30d34b0c45
commit 3f1abb30ac
  1. 4
      udr/udr.go

@ -37,13 +37,15 @@ type UDRService struct {
}
// PostRecords takes a set of UDRRecords and posts them to the UDR endpoint
func (u *UDRService) PostRecords(records []UDRRecord) (success bool, err error) {
func (u *UDRService) PostRecords(records []UDRRecord) (success bool, recordsWritten int, err error) {
success = true
recordsWritten = 0
for _, r := range records {
success, err = u.PostRecord(r)
if !success {
return
}
recordsWritten++
}
return
}

Loading…
Cancel
Save