RandomAddr returns a random IP address in the service prefix.
()
| 413 | |
| 414 | // RandomAddr returns a random IP address in the service prefix. |
| 415 | func (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. |
| 420 | func (p ServicePrefix) AddrFromUUID(uid uuid.UUID) netip.Addr { |