|
|
@ -21,6 +21,10 @@ const (
|
|
|
|
// This prefix is used in the control protocol, so cannot be
|
|
|
|
// This prefix is used in the control protocol, so cannot be
|
|
|
|
// changed.
|
|
|
|
// changed.
|
|
|
|
discoPublicHexPrefix = "discokey:"
|
|
|
|
discoPublicHexPrefix = "discokey:"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// DiscoPublicRawLen is the length in bytes of a DiscoPublic, when
|
|
|
|
|
|
|
|
// serialized with AppendTo, Raw32 or WriteRawWithoutAllocating.
|
|
|
|
|
|
|
|
DiscoPublicRawLen = 32
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
// DiscoPrivate is a disco key, used for peer-to-peer path discovery.
|
|
|
|
// DiscoPrivate is a disco key, used for peer-to-peer path discovery.
|
|
|
@ -115,12 +119,6 @@ func (k DiscoPublic) AppendTo(buf []byte) []byte {
|
|
|
|
return append(buf, k.k[:]...)
|
|
|
|
return append(buf, k.k[:]...)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// RawLen returns the length of k when to the format handled by
|
|
|
|
|
|
|
|
// ReadRawWithoutAllocating and WriteRawWithoutAllocating.
|
|
|
|
|
|
|
|
func (k DiscoPublic) RawLen() int {
|
|
|
|
|
|
|
|
return 32
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// String returns the output of MarshalText as a string.
|
|
|
|
// String returns the output of MarshalText as a string.
|
|
|
|
func (k DiscoPublic) String() string {
|
|
|
|
func (k DiscoPublic) String() string {
|
|
|
|
bs, err := k.MarshalText()
|
|
|
|
bs, err := k.MarshalText()
|
|
|
|