Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler packets handler
type Packet ¶
type Packet struct { ID primitive.ObjectID `json:"id" bson:"_id"` Device string `json:"device" bson:"Device"` Type float64 `json:"type" bson:"Type"` SrcIP string `json:"src_ip" bson:"SrcIP"` DstIP string `json:"dst_ip" bson:"DstIP"` SrcPort string `json:"src_port" bson:"SrcPort"` DstPort string `json:"dst_port" bson:"DstPort"` Payload string `json:"payload" bson:"Payload"` CapturedAt *time.Time `json:"captured_at" bson:"CapturedAt"` CapturedAtNano int64 `bson:"CapturedAtNano"` }
Packet used to hold packet data
type Repository ¶
type Repository interface { // FindAll returns all the packets from storage FindAll() ([]Packet, error) // Store stores a new packet Store(p Packet) error }
Repository defines the methods to be implemented by the storage layer.
func NewRepository ¶
func NewRepository(c *mongo.Client) Repository
NewRepository returns a new mongo Repository
Click to show internal directories.
Click to hide internal directories.