-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
667ae71
commit 2f4a312
Showing
6 changed files
with
123 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// Package sweeper pkg/sweeper/memory_processor.go | ||
package sweeper | ||
|
||
import ( | ||
"context" | ||
"sync" | ||
"time" | ||
|
||
"github.com/mfreeman451/serviceradar/pkg/models" | ||
) | ||
|
||
// InMemoryProcessor implements ResultProcessor with in-memory state. | ||
type InMemoryProcessor struct { | ||
mu sync.RWMutex | ||
hostMap map[string]*models.HostResult | ||
portCounts map[int]int | ||
lastSweepTime time.Time | ||
totalHosts int | ||
} | ||
|
||
func (i *InMemoryProcessor) Process(result *models.Result) error { | ||
//TODO implement me | ||
panic("implement me") | ||
} | ||
|
||
func (i *InMemoryProcessor) GetSummary(ctx context.Context) (*models.SweepSummary, error) { | ||
//TODO implement me | ||
panic("implement me") | ||
} | ||
|
||
func (i *InMemoryProcessor) Reset() { | ||
//TODO implement me | ||
panic("implement me") | ||
} | ||
|
||
func NewInMemoryProcessor() ResultProcessor { | ||
return &InMemoryProcessor{ | ||
hostMap: make(map[string]*models.HostResult), | ||
portCounts: make(map[int]int), | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters