File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- module github.com/k8spacket/plugin-api
1+ module github.com/k8spacket/plugin-api/v2
22
33go 1.21
4-
5- retract v1.0.0 // Published accidentally.
Original file line number Diff line number Diff line change 11package plugin_api
22
3- import "net/http"
3+ import (
4+ "net/http"
5+ )
46
5- type ReassembledStream struct {
6- StreamId uint32
7- Src string
8- SrcPort string
9- SrcName string
10- SrcNamespace string
11- Dst string
12- DstPort string
13- DstName string
14- DstNamespace string
15- Closed bool
16- BytesSent float64
17- BytesReceived float64
18- Duration float64
7+ type Address struct {
8+ Addr string
9+ Port uint16
10+ Name string
11+ Namespace string
12+ }
13+ type TCPEvent struct {
14+ Client Address
15+ Server Address
16+ TxB uint64
17+ RxB uint64
18+ DeltaUs uint64
1919}
2020
21- type TCPPacketPayload struct {
22- StreamId uint32
23- Payload []byte
21+ type TLSEvent struct {
22+ Client Address
23+ Server Address
24+ TlsVersions []uint16
25+ Ciphers []uint16
26+ ServerName string
27+ UsedTlsVersion uint16
28+ UsedCipher uint16
2429}
2530
26- type StreamPlugin interface {
31+ type ConsumerPlugin interface {
2732 InitPlugin (manager PluginManager )
28- DistributeReassembledStream (stream ReassembledStream )
29- DistributeTCPPacketPayload (tcpPacket TCPPacketPayload )
33+ }
34+
35+ type TCPConsumerPlugin interface {
36+ ConsumerPlugin
37+ DistributeTCPEvent (tcpEvent TCPEvent )
38+ }
39+
40+ type TLSConsumerPlugin interface {
41+ ConsumerPlugin
42+ DistributeTLSEvent (tlsEvent TLSEvent )
3043}
3144
3245type PluginManager interface {
33- RegisterPlugin (plugin StreamPlugin )
46+ RegisterTCPPlugin (plugin TCPConsumerPlugin )
47+ RegisterTLSPlugin (plugin TLSConsumerPlugin )
3448 RegisterHttpHandler (pattern string , handler func (http.ResponseWriter , * http.Request ))
3549}
You can’t perform that action at this time.
0 commit comments