Documentation ¶
Index ¶
- Variables
- type Config
- type PKI
- type Storage
- func (s *Storage) AccountCreate(inboxID string, secretKey ed25519.PrivateKey) error
- func (s *Storage) AccountExecute(inboxID string, action func(account *selfcrypto.Account) error) error
- func (s *Storage) AccountOffset(inboxID string) (int64, error)
- func (s *Storage) Close() error
- func (s *Storage) Decrypt(from, to string, offset int64, ciphertext []byte) ([]byte, error)
- func (s *Storage) Encrypt(from string, to []string, plaintext []byte) ([]byte, error)
- func (s *Storage) SessionList(asIdentifier string) ([]string, error)
- func (s *Storage) SessionPurge(asIdentifier, withIdentifier string) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInvalidRecipients returned when an empty list of recipients is provided ErrInvalidRecipients = errors.New("recipient list is empty") // ErrSessionNotFound session was not found for a given recipient and sender ErrSessionNotFound = errors.New("there is no existing session that matches the given sender and recipient") // ErrInvalidGroupMessageRecipient a received message is not intended for this identity ErrInvalidGroupMessageRecipient = errors.New("group message does not contain a recipient header for this identity") // ErrDecryptionFailed returned when a session failed to decrypt a message ErrDecryptionFailed = errors.New("session failed to decrypt message") )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { StorageDir string EncryptionKey string AccountID string SyncInterval time.Duration PKI PKI }
Config messaging configuration for connecting to self messaging
type PKI ¶
type PKI interface { GetHistory(selfID string) ([]json.RawMessage, error) GetDeviceKey(selfID, deviceID string) ([]byte, error) SetDeviceKeys(selfID, deviceID string, pkb []byte) error ListDeviceKeys(selfID, deviceID string) ([]byte, error) }
PKI the public key infrastructure provider used to retrieve and store keys
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
Stoprage the default storage implementation based on sqlite
func (*Storage) AccountCreate ¶
func (s *Storage) AccountCreate(inboxID string, secretKey ed25519.PrivateKey) error
func (*Storage) AccountExecute ¶
func (s *Storage) AccountExecute(inboxID string, action func(account *selfcrypto.Account) error) error
AccountExecute executes an action on an account
func (*Storage) AccountOffset ¶
AccountOffset returns the latest offset for an account that messages will be resumed from
func (*Storage) SessionPurge ¶
Click to show internal directories.
Click to hide internal directories.