Skip to content

Commit

Permalink
chore: format
Browse files Browse the repository at this point in the history
  • Loading branch information
tobyxdd committed May 8, 2024
1 parent abd7725 commit 70fee14
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
6 changes: 3 additions & 3 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ type cliConfigIO struct {
}

type cliConfigReplay struct {
Realtime bool `mapstructure:"realtime"`
Realtime bool `mapstructure:"realtime"`
}

type cliConfigWorkers struct {
Expand Down Expand Up @@ -212,8 +212,8 @@ func (c *cliConfig) fillIO(config *engine.Config) error {
// Setup IO for pcap file replay
logger.Info("replaying from pcap file", zap.String("pcap file", pcapFile))
ioImpl, err = io.NewPcapPacketIO(io.PcapPacketIOConfig{
PcapFile: pcapFile,
Realtime: c.Replay.Realtime,
PcapFile: pcapFile,
Realtime: c.Replay.Realtime,
})
} else {
// Setup IO for nfqueue
Expand Down
7 changes: 3 additions & 4 deletions io/pcap.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,16 @@ type pcapPacketIO struct {
ioCancel context.CancelFunc
config PcapPacketIOConfig

dialer *net.Dialer
dialer *net.Dialer
}

type PcapPacketIOConfig struct {
PcapFile string
Realtime bool
PcapFile string
Realtime bool
}

func NewPcapPacketIO(config PcapPacketIOConfig) (PacketIO, error) {
handle, err := pcap.OpenOffline(config.PcapFile)

if err != nil {
return nil, err
}
Expand Down

0 comments on commit 70fee14

Please sign in to comment.