mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-06-28 09:10:09 +00:00
* Fix `panic: interface conversion: api.RequestResponseMatcher is nil, not *http.requestResponseMatcher` error Also fix the request-response matcher maps iteration in `clean()` method. * Fix the mocks in the unit tests * Remove unnecessary fields from `tlsPoller` and implement `SetProtocol` method * Use concrete types in `tap` package * Share the streams map with the TLS tapper * Check interface conversion error
46 lines
867 B
Go
46 lines
867 B
Go
package kafka
|
|
|
|
import (
|
|
"sync"
|
|
|
|
"github.com/up9inc/mizu/tap/api"
|
|
)
|
|
|
|
type tcpStream struct {
|
|
isClosed bool
|
|
protoIdentifier *api.ProtoIdentifier
|
|
isTapTarget bool
|
|
origin api.Capture
|
|
reqResMatchers []api.RequestResponseMatcher
|
|
sync.Mutex
|
|
}
|
|
|
|
func NewTcpStream(capture api.Capture) api.TcpStream {
|
|
return &tcpStream{
|
|
origin: capture,
|
|
protoIdentifier: &api.ProtoIdentifier{},
|
|
}
|
|
}
|
|
|
|
func (t *tcpStream) SetProtocol(protocol *api.Protocol) {}
|
|
|
|
func (t *tcpStream) GetOrigin() api.Capture {
|
|
return t.origin
|
|
}
|
|
|
|
func (t *tcpStream) GetProtoIdentifier() *api.ProtoIdentifier {
|
|
return t.protoIdentifier
|
|
}
|
|
|
|
func (t *tcpStream) GetReqResMatchers() []api.RequestResponseMatcher {
|
|
return t.reqResMatchers
|
|
}
|
|
|
|
func (t *tcpStream) GetIsTapTarget() bool {
|
|
return t.isTapTarget
|
|
}
|
|
|
|
func (t *tcpStream) GetIsClosed() bool {
|
|
return t.isClosed
|
|
}
|