MCPcopy Create free account
hub / github.com/SamNet-dev/snix / startIP

Method startIP

tui/scan.go:287–309  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

285}
286
287func (m *scanModel) startIP() tea.Cmd {
288 m.reset()
289 m.running = true
290 m.mode = scanModeIP
291 m.started = time.Now()
292 m.ips = nil
293 m.ipDone = 0
294 m.ipTotal = len(scanner.DefaultCloudflareIPs)
295
296 ctx, cancel := context.WithCancel(context.Background())
297 m.cancel = cancel
298 return func() tea.Msg {
299 results := scanner.ProbeIPs(ctx, scanner.DefaultCloudflareIPs, 443,
300 2*time.Second, 16, nil)
301 cmds := make([]tea.Cmd, 0, len(results)+1)
302 for _, r := range results {
303 r := r
304 cmds = append(cmds, func() tea.Msg { return ipResultMsg(r) })
305 }
306 cmds = append(cmds, func() tea.Msg { return scanDoneMsg{} })
307 return tea.Sequence(cmds...)()
308 }
309}
310
311func (m *scanModel) startAll() tea.Cmd {
312 return tea.Batch(m.startSNI(), m.startIP())

Callers 2

UpdateMethod · 0.95
startAllMethod · 0.95

Calls 3

resetMethod · 0.95
ProbeIPsFunction · 0.92
ipResultMsgTypeAlias · 0.85

Tested by

no test coverage detected