Skip to content

Commit

Permalink
Seach exact function
Browse files Browse the repository at this point in the history
  • Loading branch information
xeome committed Oct 18, 2023
1 parent 9528524 commit 4bbd98c
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions internal/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,19 @@ func searchInQueue(searchQuery string) []*Task {

return results
}

func searchExactCredentials(sourceDetails, destinationDetails Credentials) []*Task {
var results []*Task
for i, e := 0, queue.Front(); i < queue.Len() && e != nil; i, e = i+1, e.Next() {
task := e.Value.(*Task)
if task.SourceAccount == sourceDetails.Account &&
task.SourceServer == sourceDetails.Server &&
task.SourcePassword == sourceDetails.Password &&
task.DestinationAccount == destinationDetails.Account &&
task.DestinationServer == destinationDetails.Server &&
task.DestinationPassword == destinationDetails.Password {
results = append(results, task)
}
}
return results
}

0 comments on commit 4bbd98c

Please sign in to comment.