gowaku

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2022 License: MIT Imports: 26 Imported by: 0

README

Mobile

Package mobile implements gomobile bindings for go-waku.

Usage

For properly using this package, please refer to Makefile in the root of go-waku directory.

To manually build library, run following commands:

iOS
gomobile init
gomobile bind -v -target=ios -ldflags="-s -w" github.com/status-im/go-waku/mobile

This will produce gowaku.framework file in the current directory, which can be used in iOS project.

Android
export ANDROID_NDK_HOME=/path/to/android/ndk
export ANDROID_HOME=/path/to/android/sdk/
gomobile init
gomobile bind -v -target=android -ldflags="-s -w" github.com/status-im/go-waku/mobile

This will generate gowaku.aar file in the current dir.

Notes

See https://github.com/golang/go/wiki/Mobile for more information on gomobile usage.

Documentation

Overview

Implements gomobile bindings for go-waku. Contains a set of functions that are exported when go-waku is exported as libraries for mobile devices

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddPeer

func AddPeer(address string, protocolID string) string

func Connect

func Connect(address string, ms int) string

func ConnectPeerID

func ConnectPeerID(peerID string, ms int) string

func ContentTopic

func ContentTopic(applicationName string, applicationVersion int, contentTopicName string, encoding string) string

func DecodeAsymmetric

func DecodeAsymmetric(messageJSON string, privateKey string) string

func DecodeSymmetric

func DecodeSymmetric(messageJSON string, symmetricKey string) string

func DefaultPubsubTopic

func DefaultPubsubTopic() string

func Disconnect

func Disconnect(peerID string) string

func FilterSubscribe added in v0.2.0

func FilterSubscribe(filterJSON string, peerID string, ms int) string

func FilterUnsubscribe added in v0.2.0

func FilterUnsubscribe(filterJSON string, ms int) string

func IsStarted added in v0.2.0

func IsStarted() string

func LightpushPublish

func LightpushPublish(messageJSON string, topic string, peerID string, ms int) string

func LightpushPublishEncodeAsymmetric

func LightpushPublishEncodeAsymmetric(messageJSON string, topic string, peerID string, publicKey string, optionalSigningKey string, ms int) string

func LightpushPublishEncodeSymmetric

func LightpushPublishEncodeSymmetric(messageJSON string, topic string, peerID string, symmetricKey string, optionalSigningKey string, ms int) string

func ListenAddresses

func ListenAddresses() string

func NewNode

func NewNode(configJSON string) string

func PeerCnt

func PeerCnt() string

func PeerID

func PeerID() string

func Peers

func Peers() string

func PubsubTopic

func PubsubTopic(name string, encoding string) string

func RelayEnoughPeers

func RelayEnoughPeers(topic string) string

func RelayPublish

func RelayPublish(messageJSON string, topic string, ms int) string

func RelayPublishEncodeAsymmetric

func RelayPublishEncodeAsymmetric(messageJSON string, topic string, publicKey string, optionalSigningKey string, ms int) string

func RelayPublishEncodeSymmetric

func RelayPublishEncodeSymmetric(messageJSON string, topic string, symmetricKey string, optionalSigningKey string, ms int) string

func RelaySubscribe

func RelaySubscribe(topic string) string

func RelayUnsubscribe

func RelayUnsubscribe(topic string) string

func SetEventCallback

func SetEventCallback(cb unsafe.Pointer)

func SetMobileSignalHandler

func SetMobileSignalHandler(handler SignalHandler)

SetMobileSignalHandler setup geth callback to notify about new signal used for gomobile builds nolint

func Start

func Start() string

func Stop

func Stop() string

func StoreQuery

func StoreQuery(queryJSON string, peerID string, ms int) string

Types

type FilterArgument added in v0.2.0

type FilterArgument struct {
	Topic          string             `json:"pubsubTopic,omitempty"`
	ContentFilters []pb.ContentFilter `json:"contentFilters,omitempty"`
}

type MobileSignalHandler

type MobileSignalHandler func([]byte)

SignalHandler is a simple callback function that gets called when any signal is received

type SignalHandler

type SignalHandler interface {
	HandleSignal(string)
}

SignalHandler defines a minimal interface a signal handler needs to implement. nolint

Jump to

Keyboard shortcuts

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