mirror of
https://github.com/weaveworks/scope.git
synced 2026-03-03 02:00:43 +00:00
refactor: remove pointless interface
premature abstraction
This commit is contained in:
@@ -27,7 +27,7 @@ type connectionTrackerConfig struct {
|
||||
type connectionTracker struct {
|
||||
conf connectionTrackerConfig
|
||||
flowWalker flowWalker // Interface
|
||||
ebpfTracker eventTracker
|
||||
ebpfTracker *EbpfTracker
|
||||
reverseResolver *reverseResolver
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user