Discover Packages
yuki.nu/g/yukinet
protocol
discovery
package
Version:
v0.2.26
Opens a new window with list of versions in this module.
Published: Aug 7, 2024
License: MIT
Opens a new window with license information.
Imports: 6
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
View Source
const (
DiscoveryQueryTimeout = 20 * time .Second
)
PublishChannel publishes current peerinfo into the connection to the server.
Returns any error encountered, the connection will stay alive after the publish is done.
type PeerInfo struct {
CreatedAt time .Time `json:"create-at"`
Channel string `json:"channel"`
AddressURLs []string `json:"address-urls"`
}
QueryChannel queries the channel info from the connection to the server.
The connection will not be closed by this function.
type Request struct {
Type string `json:"type"`
Payload string `json:"payload"`
PeerInfo []PeerInfo `json:"peer-info"`
}
type Response struct {
Payload string `json:"payload"`
PeerInfo []PeerInfo `json:"peer-info"`
Success bool `json:"success"`
}
ServeConnection will close the connection once done.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.