Documentation ¶
Index ¶
- func GenerateConfigJSON() []byte
- func GetVersion() string
- type MobileLogger
- type Ruvmeshnet
- func (m *Ruvmeshnet) GetAddressString() string
- func (m *Ruvmeshnet) GetMTU() int
- func (m *Ruvmeshnet) GetPathsJSON() (result string)
- func (m *Ruvmeshnet) GetPeersJSON() (result string)
- func (m *Ruvmeshnet) GetPublicKeyString() string
- func (m *Ruvmeshnet) GetRoutingEntries() int
- func (m *Ruvmeshnet) GetSubnetString() string
- func (m *Ruvmeshnet) GetTreeJSON() (result string)
- func (m *Ruvmeshnet) Recv() ([]byte, error)
- func (m *Ruvmeshnet) RecvBuffer(buf []byte) (int, error)
- func (m *Ruvmeshnet) RetryPeersNow()
- func (m *Ruvmeshnet) Send(p []byte) error
- func (m *Ruvmeshnet) SendBuffer(p []byte, length int) error
- func (m *Ruvmeshnet) StartAutoconfigure() error
- func (m *Ruvmeshnet) StartJSON(configjson []byte) error
- func (m *Ruvmeshnet) Stop() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateConfigJSON ¶
func GenerateConfigJSON() []byte
GenerateConfigJSON generates mobile-friendly configuration in JSON format
func GetVersion ¶
func GetVersion() string
Types ¶
type MobileLogger ¶
type MobileLogger struct { }
type Ruvmeshnet ¶
type Ruvmeshnet struct {
// contains filtered or unexported fields
}
Ruvmeshnet mobile package is meant to "plug the gap" for mobile support, as Gomobile will not create headers for Swift/Obj-C etc if they have complex (non-native) types. Therefore for iOS we will expose some nice simple functions. Note that in the case of iOS we handle reading/writing to/from TUN in Swift therefore we use the "dummy" TUN interface instead.
func (*Ruvmeshnet) GetAddressString ¶
func (m *Ruvmeshnet) GetAddressString() string
GetAddressString gets the node's IPv6 address
func (*Ruvmeshnet) GetMTU ¶
func (m *Ruvmeshnet) GetMTU() int
GetMTU returns the configured node MTU. This must be called AFTER Start.
func (*Ruvmeshnet) GetPathsJSON ¶
func (m *Ruvmeshnet) GetPathsJSON() (result string)
func (*Ruvmeshnet) GetPeersJSON ¶
func (m *Ruvmeshnet) GetPeersJSON() (result string)
func (*Ruvmeshnet) GetPublicKeyString ¶
func (m *Ruvmeshnet) GetPublicKeyString() string
GetPublicKeyString gets the node's public key in hex form
func (*Ruvmeshnet) GetRoutingEntries ¶
func (m *Ruvmeshnet) GetRoutingEntries() int
GetRoutingEntries gets the number of entries in the routing table
func (*Ruvmeshnet) GetSubnetString ¶
func (m *Ruvmeshnet) GetSubnetString() string
GetSubnetString gets the node's IPv6 subnet in CIDR notation
func (*Ruvmeshnet) GetTreeJSON ¶
func (m *Ruvmeshnet) GetTreeJSON() (result string)
func (*Ruvmeshnet) Recv ¶
func (m *Ruvmeshnet) Recv() ([]byte, error)
Recv waits for and reads a packet coming from Ruvmeshnet. It will be a fully formed IPv6 packet
func (*Ruvmeshnet) RecvBuffer ¶
func (m *Ruvmeshnet) RecvBuffer(buf []byte) (int, error)
Recv waits for and reads a packet coming from Ruvmeshnet to given buffer, returning size of packet
func (*Ruvmeshnet) RetryPeersNow ¶
func (m *Ruvmeshnet) RetryPeersNow()
Retry resets the peer connection timer and tries to dial them immediately.
func (*Ruvmeshnet) Send ¶
func (m *Ruvmeshnet) Send(p []byte) error
Send sends a packet to Ruvmeshnet. It should be a fully formed IPv6 packet
func (*Ruvmeshnet) SendBuffer ¶
func (m *Ruvmeshnet) SendBuffer(p []byte, length int) error
Send sends a packet from given buffer to Ruvmeshnet. From first byte up to length.
func (*Ruvmeshnet) StartAutoconfigure ¶
func (m *Ruvmeshnet) StartAutoconfigure() error
StartAutoconfigure starts a node with a randomly generated config
func (*Ruvmeshnet) StartJSON ¶
func (m *Ruvmeshnet) StartJSON(configjson []byte) error
StartJSON starts a node with the given JSON config. You can get JSON config (rather than HJSON) by using the GenerateConfigJSON() function