mobile

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 25, 2024 License: LGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

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 {
}

func (MobileLogger) Write

func (nsl MobileLogger) Write(p []byte) (n int, err error)

type Ruvchain

type Ruvchain struct {
	// contains filtered or unexported fields
}

Ruvchain 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 (*Ruvchain) GetAddressString

func (m *Ruvchain) GetAddressString() string

GetAddressString gets the node's IPv6 address

func (*Ruvchain) GetMTU

func (m *Ruvchain) GetMTU() int

GetMTU returns the configured node MTU. This must be called AFTER Start.

func (*Ruvchain) GetPathsJSON

func (m *Ruvchain) GetPathsJSON() (result string)

func (*Ruvchain) GetPeersJSON

func (m *Ruvchain) GetPeersJSON() (result string)

func (*Ruvchain) GetPublicKeyString

func (m *Ruvchain) GetPublicKeyString() string

GetPublicKeyString gets the node's public key in hex form

func (*Ruvchain) GetRoutingEntries

func (m *Ruvchain) GetRoutingEntries() int

GetRoutingEntries gets the number of entries in the routing table

func (*Ruvchain) GetSubnetString

func (m *Ruvchain) GetSubnetString() string

GetSubnetString gets the node's IPv6 subnet in CIDR notation

func (*Ruvchain) GetTreeJSON

func (m *Ruvchain) GetTreeJSON() (result string)

func (*Ruvchain) Recv

func (m *Ruvchain) Recv() ([]byte, error)

Recv waits for and reads a packet coming from Ruvchain. It will be a fully formed IPv6 packet

func (*Ruvchain) RecvBuffer

func (m *Ruvchain) RecvBuffer(buf []byte) (int, error)

Recv waits for and reads a packet coming from Ruvchain to given buffer, returning size of packet

func (*Ruvchain) RetryPeersNow

func (m *Ruvchain) RetryPeersNow()

Retry resets the peer connection timer and tries to dial them immediately.

func (*Ruvchain) Send

func (m *Ruvchain) Send(p []byte) error

Send sends a packet to Ruvchain. It should be a fully formed IPv6 packet

func (*Ruvchain) SendBuffer

func (m *Ruvchain) SendBuffer(p []byte, length int) error

Send sends a packet from given buffer to Ruvchain. From first byte up to length.

func (*Ruvchain) StartAutoconfigure

func (m *Ruvchain) StartAutoconfigure() error

StartAutoconfigure starts a node with a randomly generated config

func (*Ruvchain) StartJSON

func (m *Ruvchain) 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

func (*Ruvchain) Stop

func (m *Ruvchain) Stop() error

Stop the mobile Ruvchain instance

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL