Documentation
¶
Index ¶
- Constants
- type AccountAttributes
- type Client
- func (c *Client) Close() error
- func (c *Client) NewWSClient() (*WSMessagingClient, error)
- func (c *Client) PrepareEncryptedMessages(recipientID string, deviceID uint32, messages [][]byte) ([]Message, error)
- func (c *Client) ReceiveMessages() ([]*Message, bool, error)
- func (c *Client) RefreshToken(authToken string)
- func (c *Client) RegisterAccount() error
- func (c *Client) RegisterKeys() error
- func (c *Client) RegisterTemporaryAccount() error
- func (c *Client) SendMessages(recipientID string, deviceID uint32, messages [][]byte) error
- func (c *Client) SessionCipher(recipientID string, deviceID uint32) *axolotl.SessionCipher
- type Device
- type LevelDBAxolotlStore
- func (l *LevelDBAxolotlStore) Close() error
- func (l *LevelDBAxolotlStore) ContainsPreKey(id uint32) bool
- func (l *LevelDBAxolotlStore) ContainsSession(recipientID string, deviceID uint32) bool
- func (l *LevelDBAxolotlStore) ContainsSignedPreKey(id uint32) bool
- func (l *LevelDBAxolotlStore) DeleteAllSessions(string)
- func (l *LevelDBAxolotlStore) DeleteSession(recipientID string, deviceID uint32)
- func (l *LevelDBAxolotlStore) GetIdentityKeyPair() (*axolotl.IdentityKeyPair, error)
- func (l *LevelDBAxolotlStore) GetLocalRegistrationID() (uint32, error)
- func (l *LevelDBAxolotlStore) GetSubDeviceSessions(string) []uint32
- func (l *LevelDBAxolotlStore) IsTrustedIdentity(string, *axolotl.IdentityKey) bool
- func (l *LevelDBAxolotlStore) LoadPreKey(id uint32) (*axolotl.PreKeyRecord, error)
- func (l *LevelDBAxolotlStore) LoadSession(recipientID string, deviceID uint32) (*axolotl.SessionRecord, error)
- func (l *LevelDBAxolotlStore) LoadSignedPreKey(id uint32) (*axolotl.SignedPreKeyRecord, error)
- func (l *LevelDBAxolotlStore) LoadSignedPreKeys() []axolotl.SignedPreKeyRecord
- func (l *LevelDBAxolotlStore) RemovePreKey(id uint32)
- func (l *LevelDBAxolotlStore) RemoveSignedPreKey(id uint32)
- func (l *LevelDBAxolotlStore) SaveIdentity(id string, key *axolotl.IdentityKey) error
- func (l *LevelDBAxolotlStore) StoreIdentityKeyPair(kp *axolotl.IdentityKeyPair) error
- func (l *LevelDBAxolotlStore) StorePreKey(id uint32, r *axolotl.PreKeyRecord) error
- func (l *LevelDBAxolotlStore) StoreRegistrationID(id uint32) error
- func (l *LevelDBAxolotlStore) StoreSession(recipientID string, deviceID uint32, r *axolotl.SessionRecord) error
- func (l *LevelDBAxolotlStore) StoreSignedPreKey(id uint32, r *axolotl.SignedPreKeyRecord) error
- type Message
- type Messages
- type MessagingCommand
- type MessagingCommandResponse
- type PreKey
- type PrekeyState
- type PrivateKeyStore
- type SignedPreKey
- type WSMessagePayload
- type WSMessagingClient
- func (c *WSMessagingClient) Close()
- func (c *WSMessagingClient) Command(cmd MessagingCommand) MessagingCommandResponse
- func (c *WSMessagingClient) SendWhisperMessages(to string, deviceID uint32, messages [][]byte) MessagingCommandResponse
- func (c *WSMessagingClient) WhisperMessages() <-chan *Message
Constants ¶
const ( MessageTypeUnknown = iota MessageTypeCiphertext MessageTypeKeyExchange MessageTypePrekeyBundle MessageTypeReceipt MessageTypeUnidentifiedSender )
const (
MasterDeviceId = 1
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountAttributes ¶
type AccountAttributes struct {
RegistrationID uint32 `json:"registrationId"`
}
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) NewWSClient ¶
func (c *Client) NewWSClient() (*WSMessagingClient, error)
NewWSClient creates a websocket client based on the configuration from the HTTP client
func (*Client) PrepareEncryptedMessages ¶
func (c *Client) PrepareEncryptedMessages(recipientID string, deviceID uint32, messages [][]byte) ([]Message, error)
PrepareEncryptedMessages generates encrypted messages by local session and remote recipient key
func (*Client) RefreshToken ¶
RefreshToken updates current authToken with a new value
func (*Client) RegisterAccount ¶
func (*Client) RegisterKeys ¶
func (*Client) RegisterTemporaryAccount ¶
func (*Client) SendMessages ¶
func (*Client) SessionCipher ¶
func (c *Client) SessionCipher(recipientID string, deviceID uint32) *axolotl.SessionCipher
SessionCipher returns a session cipher with a specific recipient id and device id
type Device ¶
type Device struct { ID uint32 `json:"deviceId"` RegistrationID uint32 `json:"registrationId"` SignedPreKey SignedPreKey `json:"signedPreKey"` PreKey PreKey `json:"preKey"` }
type LevelDBAxolotlStore ¶
func (*LevelDBAxolotlStore) Close ¶
func (l *LevelDBAxolotlStore) Close() error
Close is to close the database
func (*LevelDBAxolotlStore) ContainsPreKey ¶
func (l *LevelDBAxolotlStore) ContainsPreKey(id uint32) bool
func (*LevelDBAxolotlStore) ContainsSession ¶
func (l *LevelDBAxolotlStore) ContainsSession(recipientID string, deviceID uint32) bool
func (*LevelDBAxolotlStore) ContainsSignedPreKey ¶
func (l *LevelDBAxolotlStore) ContainsSignedPreKey(id uint32) bool
func (*LevelDBAxolotlStore) DeleteAllSessions ¶
func (l *LevelDBAxolotlStore) DeleteAllSessions(string)
func (*LevelDBAxolotlStore) DeleteSession ¶
func (l *LevelDBAxolotlStore) DeleteSession(recipientID string, deviceID uint32)
func (*LevelDBAxolotlStore) GetIdentityKeyPair ¶
func (l *LevelDBAxolotlStore) GetIdentityKeyPair() (*axolotl.IdentityKeyPair, error)
IdentityStore
func (*LevelDBAxolotlStore) GetLocalRegistrationID ¶
func (l *LevelDBAxolotlStore) GetLocalRegistrationID() (uint32, error)
func (*LevelDBAxolotlStore) GetSubDeviceSessions ¶
func (l *LevelDBAxolotlStore) GetSubDeviceSessions(string) []uint32
func (*LevelDBAxolotlStore) IsTrustedIdentity ¶
func (l *LevelDBAxolotlStore) IsTrustedIdentity(string, *axolotl.IdentityKey) bool
func (*LevelDBAxolotlStore) LoadPreKey ¶
func (l *LevelDBAxolotlStore) LoadPreKey(id uint32) (*axolotl.PreKeyRecord, error)
PreKeyStore
func (*LevelDBAxolotlStore) LoadSession ¶
func (l *LevelDBAxolotlStore) LoadSession(recipientID string, deviceID uint32) (*axolotl.SessionRecord, error)
SessionStore
func (*LevelDBAxolotlStore) LoadSignedPreKey ¶
func (l *LevelDBAxolotlStore) LoadSignedPreKey(id uint32) (*axolotl.SignedPreKeyRecord, error)
SignedPreKeyStore
func (*LevelDBAxolotlStore) LoadSignedPreKeys ¶
func (l *LevelDBAxolotlStore) LoadSignedPreKeys() []axolotl.SignedPreKeyRecord
func (*LevelDBAxolotlStore) RemovePreKey ¶
func (l *LevelDBAxolotlStore) RemovePreKey(id uint32)
func (*LevelDBAxolotlStore) RemoveSignedPreKey ¶
func (l *LevelDBAxolotlStore) RemoveSignedPreKey(id uint32)
func (*LevelDBAxolotlStore) SaveIdentity ¶
func (l *LevelDBAxolotlStore) SaveIdentity(id string, key *axolotl.IdentityKey) error
func (*LevelDBAxolotlStore) StoreIdentityKeyPair ¶
func (l *LevelDBAxolotlStore) StoreIdentityKeyPair(kp *axolotl.IdentityKeyPair) error
func (*LevelDBAxolotlStore) StorePreKey ¶
func (l *LevelDBAxolotlStore) StorePreKey(id uint32, r *axolotl.PreKeyRecord) error
func (*LevelDBAxolotlStore) StoreRegistrationID ¶
func (l *LevelDBAxolotlStore) StoreRegistrationID(id uint32) error
func (*LevelDBAxolotlStore) StoreSession ¶
func (l *LevelDBAxolotlStore) StoreSession(recipientID string, deviceID uint32, r *axolotl.SessionRecord) error
func (*LevelDBAxolotlStore) StoreSignedPreKey ¶
func (l *LevelDBAxolotlStore) StoreSignedPreKey(id uint32, r *axolotl.SignedPreKeyRecord) error
type Message ¶
type Message struct { Guid uuid.UUID `json:"guid"` Type int32 `json:"type"` Source string `json:"source"` SourceDevice uint32 `json:"sourceDevice"` DestDeviceID uint32 `json:"destinationDeviceId"` DestRegistrationID uint32 `json:"destinationRegistrationId"` Content []byte `json:"content"` ServerTimestamp int64 `json:"serverTimestamp"` }
type MessagingCommand ¶
type PrekeyState ¶
type PrivateKeyStore ¶
type SignedPreKey ¶
type WSMessagePayload ¶
type WSMessagePayload struct { Type string `json:"type"` Data json.RawMessage `json:"data"` }
WSMessagePayload is the websocket wrapped message for signal message and command response
type WSMessagingClient ¶
func (*WSMessagingClient) Close ¶
func (c *WSMessagingClient) Close()
Close will close the websocket connection which leads the cleaning process being triggered
func (*WSMessagingClient) Command ¶
func (c *WSMessagingClient) Command(cmd MessagingCommand) MessagingCommandResponse
Command sends messaging command through messaging websocket client
func (*WSMessagingClient) SendWhisperMessages ¶
func (c *WSMessagingClient) SendWhisperMessages(to string, deviceID uint32, messages [][]byte) MessagingCommandResponse
SendWhisperMessages is a shortcuts for send messages via websocket connection
func (*WSMessagingClient) WhisperMessages ¶
func (c *WSMessagingClient) WhisperMessages() <-chan *Message
WhisperMessages starts a process to process incoming messages and returns a read channel of decrypted signal messages