Categorygithub.com/bitmark-inc/autonomy-messaging-go
modulepackage
0.1.1
Repository: https://github.com/bitmark-inc/autonomy-messaging-go.git
Documentation: pkg.go.dev

# README

Autonomy Messaging Go

The messaging protocol for making communications between Autonomy pods.

Usage

Before using the messaging library, it asumes that a user has already get a new authentication token from the Autonomy API server.

Setup

First, create a messaging client:

messagingClient := messaging.New(
	&http.Client{Timeout: 10 * time.Second},
	"http://localhost:8080",
	"authentication-token",
	"/path/to/messaging.db",
)

And register an account:

messagingClient.RegisterAccount()

After that you need to register pre-keys so that other client can start conversations with you:

messagingClient.RegisterKeys()

Once everything is done, we can create a websocket connection to send and receive messages:

wsClient := messagingClient.NewWSClient()

Send and Receive

WhisperMessages returns a channel of messages.

messages := wsClient.WhisperMessages()
m := <-messages

For sending messages to others, we can use SendWhisperMessages

wsClient.SendWhisperMessages("<destination DID>", device_id, responseBody)

# Functions

No description provided by the author

# Constants

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Structs

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
WSMessagePayload is the websocket wrapped message for signal message and command response.
No description provided by the author

# Interfaces

No description provided by the author