mirror of
https://github.com/luxfi/net.git
synced 2026-10-30 15:24:11 +00:00
38 lines
536 B
Go
38 lines
536 B
Go
// Copyright (C) 2019-2025, Lux Industries, Inc. All rights reserved.
|
|
// See the file LICENSE for licensing terms.
|
|
|
|
package beacon
|
|
|
|
import (
|
|
"net/netip"
|
|
|
|
"github.com/luxfi/ids"
|
|
)
|
|
|
|
var _ Beacon = (*beacon)(nil)
|
|
|
|
type Beacon interface {
|
|
ID() ids.NodeID
|
|
IP() netip.AddrPort
|
|
}
|
|
|
|
type beacon struct {
|
|
id ids.NodeID
|
|
ip netip.AddrPort
|
|
}
|
|
|
|
func New(id ids.NodeID, ip netip.AddrPort) Beacon {
|
|
return &beacon{
|
|
id: id,
|
|
ip: ip,
|
|
}
|
|
}
|
|
|
|
func (b *beacon) ID() ids.NodeID {
|
|
return b.id
|
|
}
|
|
|
|
func (b *beacon) IP() netip.AddrPort {
|
|
return b.ip
|
|
}
|