Documentation ¶
Index ¶
- func AddIgnoredLocalCIDRs(cidrs ...string)
- func GetIgnoredLocalCIDRs() []net.IPNet
- func GetIgnoredLocalInterfaceNamePrefixs() []string
- func IPIgnored(ip net.IP) bool
- func ListLocalIPs() ([]net.IP, error)
- func MustParseNonce(nonce string) byte
- func NewNonce() string
- func RemoveIgnoredLocalCIDRs(cidrs ...string)
- func SetIgnoredLocalCIDRs(cidrs ...string)
- func SetIgnoredLocalInterfaceNamePrefixs(prefixs ...string)
- func SetLocalIPs(ips ...net.IP)
- type ControlCode
- type Controller
- type ControllerManager
- type Datagram
- type Disco
- type Error
- type FileSecretStore
- type NATInfo
- type NATType
- type NetworkSecret
- type Peer
- type PeerID
- type PeerUDPAddr
- type Peermap
- type SecretStore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddIgnoredLocalCIDRs ¶ added in v0.0.2
func AddIgnoredLocalCIDRs(cidrs ...string)
func GetIgnoredLocalCIDRs ¶ added in v0.6.2
func GetIgnoredLocalInterfaceNamePrefixs ¶ added in v0.6.2
func GetIgnoredLocalInterfaceNamePrefixs() []string
func ListLocalIPs ¶
func MustParseNonce ¶ added in v0.7.3
func RemoveIgnoredLocalCIDRs ¶ added in v0.6.1
func RemoveIgnoredLocalCIDRs(cidrs ...string)
func SetIgnoredLocalCIDRs ¶
func SetIgnoredLocalCIDRs(cidrs ...string)
func SetIgnoredLocalInterfaceNamePrefixs ¶
func SetIgnoredLocalInterfaceNamePrefixs(prefixs ...string)
func SetLocalIPs ¶ added in v0.0.2
Types ¶
type ControlCode ¶ added in v0.7.3
type ControlCode uint8
const ( CONTROL_RELAY ControlCode = 0 CONTROL_NEW_PEER ControlCode = 1 CONTROL_NEW_PEER_UDP_ADDR ControlCode = 2 CONTROL_LEAD_DISCO ControlCode = 3 CONTROL_UPDATE_NETWORK_SECRET ControlCode = 20 CONTROL_UPDATE_NAT_INFO ControlCode = 21 CONTROL_CONN ControlCode = 30 )
func (ControlCode) Byte ¶ added in v0.7.3
func (code ControlCode) Byte() byte
func (ControlCode) String ¶ added in v0.7.3
func (code ControlCode) String() string
type Controller ¶ added in v0.6.1
type ControllerManager ¶ added in v0.6.1
type ControllerManager interface { Register(Controller) Unregister(Controller) }
type Datagram ¶
Datagram is the packet from peer or to peer
func (*Datagram) TryDecrypt ¶
TryDecrypt the datagram from peer
type FileSecretStore ¶ added in v0.7.3
type FileSecretStore struct {
StoreFilePath string
}
func (*FileSecretStore) NetworkSecret ¶ added in v0.7.3
func (s *FileSecretStore) NetworkSecret() (NetworkSecret, error)
func (*FileSecretStore) UpdateNetworkSecret ¶ added in v0.7.3
func (s *FileSecretStore) UpdateNetworkSecret(secret NetworkSecret) error
type NetworkSecret ¶ added in v0.7.3
type NetworkSecret struct { Secret string `json:"secret"` Network string `json:"network"` Expire time.Time `json:"expire"` }
func (NetworkSecret) Expired ¶ added in v0.7.3
func (s NetworkSecret) Expired() bool
func (*NetworkSecret) NetworkSecret ¶ added in v0.7.3
func (s *NetworkSecret) NetworkSecret() (NetworkSecret, error)
func (*NetworkSecret) UpdateNetworkSecret ¶ added in v0.7.3
func (s *NetworkSecret) UpdateNetworkSecret(secret NetworkSecret) error
type PeerUDPAddr ¶ added in v0.6.4
PeerUDPAddr describe the peer udp addr
type Peermap ¶ added in v0.7.3
type Peermap struct {
// contains filtered or unexported fields
}
func NewPeermap ¶ added in v0.7.3
func NewPeermap(server *url.URL, store SecretStore) (*Peermap, error)
func NewPeermapURL ¶ added in v0.7.3
func NewPeermapURL(serverURL string, store SecretStore) (*Peermap, error)
func (*Peermap) SecretStore ¶ added in v0.7.3
func (s *Peermap) SecretStore() SecretStore
type SecretStore ¶ added in v0.7.3
type SecretStore interface { NetworkSecret() (NetworkSecret, error) UpdateNetworkSecret(NetworkSecret) error }
Click to show internal directories.
Click to hide internal directories.