refactor: remove pointless interface

premature abstraction
This commit is contained in:
Matthias Radestock
2017-07-10 09:12:45 +01:00
parent 8a56540648
commit ad7b5cdc19
2 changed files with 2 additions and 11 deletions

View File

@@ -27,7 +27,7 @@ type connectionTrackerConfig struct {
type connectionTracker struct {
conf connectionTrackerConfig
flowWalker flowWalker // Interface
ebpfTracker eventTracker
ebpfTracker *EbpfTracker
reverseResolver *reverseResolver
}

View File

@@ -24,15 +24,6 @@ type ebpfConnection struct {
pid int
}
type eventTracker interface {
handleConnection(ev tracer.EventType, tuple fourTuple, pid int, networkNamespace string)
walkConnections(f func(ebpfConnection))
feedInitialConnections(ci procspy.ConnIter, seenTuples map[string]fourTuple, processesWaitingInAccept []int, hostNodeID string)
isReadyToHandleConnections() bool
isDead() bool
stop()
}
// EbpfTracker contains the sets of open and closed TCP connections.
// Closed connections are kept in the `closedConnections` slice for one iteration of `walkConnections`.
type EbpfTracker struct {
@@ -80,7 +71,7 @@ func isKernelSupported() error {
return nil
}
func newEbpfTracker() (eventTracker, error) {
func newEbpfTracker() (*EbpfTracker, error) {
if err := isKernelSupported(); err != nil {
return nil, fmt.Errorf("kernel not supported: %v", err)
}