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

Method RandomAddr

tailnet/conn.go:415–417  ·  view source on GitHub ↗

RandomAddr returns a random IP address in the service prefix.

()

Source from the content-addressed store, hash-verified

413
414// RandomAddr returns a random IP address in the service prefix.
415func (p ServicePrefix) RandomAddr() netip.Addr {
416 return netip.AddrFrom16(p.maskUUID(uuid.New()))
417}
418
419// AddrFromUUID returns an IPv6 address corresponding to the given UUID in the service prefix.
420func (p ServicePrefix) AddrFromUUID(uid uuid.UUID) netip.Addr {

Callers 11

RandomPrefixMethod · 0.95
TestDERPFunction · 0.80
NewConnMethod · 0.80
DialAgentMethod · 0.80
TestTailnetFunction · 0.80
TestConn_UpdateDERPFunction · 0.80
TestConn_BlockEndpointsFunction · 0.80
TestCoderServicePrefixFunction · 0.80
TestCoordinatorFunction · 0.80
setupAgentWithSecretsFunction · 0.80

Calls 2

maskUUIDMethod · 0.95
NewMethod · 0.65

Tested by 8

TestDERPFunction · 0.64
TestTailnetFunction · 0.64
TestConn_UpdateDERPFunction · 0.64
TestConn_BlockEndpointsFunction · 0.64
TestCoderServicePrefixFunction · 0.64
TestCoordinatorFunction · 0.64
setupAgentWithSecretsFunction · 0.64