MCPcopy Index your code
hub / github.com/coder/coder / ParseIP

Function ParseIP

coderd/database/types.go:357–371  ·  view source on GitHub ↗
(ipStr string)

Source from the content-addressed store, hash-verified

355}
356
357func ParseIP(ipStr string) pqtype.Inet {
358 ip := net.ParseIP(ipStr)
359 ipNet := net.IPNet{}
360 if ip != nil {
361 ipNet = net.IPNet{
362 IP: ip,
363 Mask: net.CIDRMask(len(ip)*8, len(ip)*8),
364 }
365 }
366
367 return pqtype.Inet{
368 IPNet: ipNet,
369 Valid: ip != nil,
370 }
371}
372
373// AllowList is a typed wrapper around a list of AllowListTarget entries.
374// It implements sql.Scanner and driver.Valuer so it can be stored in and

Callers 6

InitRequestFunction · 0.92
BackgroundAuditFunction · 0.92
TestConnectionLogFunction · 0.92
ReportConnectionMethod · 0.92
connLogInitRequestMethod · 0.92
assertConnLogContainsFunction · 0.92

Calls

no outgoing calls

Tested by 2

TestConnectionLogFunction · 0.74
assertConnLogContainsFunction · 0.74