mobile

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2023 License: LGPL-3.0 Imports: 16 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 Mesh

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

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

func (m *Mesh) GetAddressString() string

GetAddressString gets the node's IPv6 address

func (*Mesh) GetCoordsString

func (m *Mesh) GetCoordsString() string

GetCoordsString gets the node's coordinates

func (*Mesh) GetDHTJSON

func (m *Mesh) GetDHTJSON() (result string)

func (*Mesh) GetMTU

func (m *Mesh) GetMTU() int

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

func (*Mesh) GetPeersJSON

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

func (*Mesh) GetPublicKeyString

func (m *Mesh) GetPublicKeyString() string

GetPublicKeyString gets the node's public key in hex form

func (*Mesh) GetSubnetString

func (m *Mesh) GetSubnetString() string

GetSubnetString gets the node's IPv6 subnet in CIDR notation

func (*Mesh) Recv

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

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

func (*Mesh) RecvBuffer

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

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

func (*Mesh) RetryPeersNow

func (m *Mesh) RetryPeersNow()

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

func (*Mesh) Send

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

Send sends a packet to RiV-mesh. It should be a fully formed IPv6 packet

func (*Mesh) SendBuffer

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

Send sends a packet from given buffer to RiV-mesh. From first byte up to length.

func (*Mesh) StartAutoconfigure

func (m *Mesh) StartAutoconfigure() error

StartAutoconfigure starts a node with a randomly generated config

func (*Mesh) StartJSON

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

func (m *Mesh) Stop() error

Stop the mobile Mesh instance

type MobileLogger

type MobileLogger struct {
}

func (MobileLogger) Write

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

Jump to

Keyboard shortcuts

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