Documentation ¶
Index ¶
- Variables
- func WithChats(publicChatNames []string, publicKeys []*ecdsa.PublicKey, ...) func(c *config) error
- func WithOnNewInstallationsHandler(h func([]*multidevice.Installation)) func(c *config) error
- func WithOnNewSharedSecret(h func([]*sharedsecret.Secret)) func(c *config) error
- func WithSendV1Messages() func(c *config) error
- type Chat
- type Messenger
- func (m *Messenger) AddMailserver(enode string) error
- func (m *Messenger) DisableInstallation(id string) error
- func (m *Messenger) EnableInstallation(id string) error
- func (m *Messenger) Installations() ([]*multidevice.Installation, error)
- func (m *Messenger) Join(chat Chat) error
- func (m *Messenger) Leave(chat Chat) error
- func (m *Messenger) Mailservers() ([]string, error)
- func (m *Messenger) RemoveMailserver(id string) error
- func (m *Messenger) Retrieve(ctx context.Context, chat Chat, c RetrieveConfig) (messages []*protocol.Message, err error)
- func (m *Messenger) SelectMailserver(id string) error
- func (m *Messenger) Send(ctx context.Context, chat Chat, data []byte) ([]byte, error)
- func (m *Messenger) SetInstallationMetadata(id string, data *multidevice.InstallationMetadata) error
- type Option
- type RetrieveConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrChatIDEmpty = errors.New("chat ID is empty") ErrNotImplemented = errors.New("not implemented") )
View Source
var ( RetrieveLatest = RetrieveConfig{/* contains filtered or unexported fields */} RetrieveLastDay = RetrieveConfig{/* contains filtered or unexported fields */} )
View Source
var ( // ErrMsgAlreadyExist returned if msg already exist. ErrMsgAlreadyExist = errors.New("message with given ID already exist") )
Functions ¶
func WithOnNewInstallationsHandler ¶
func WithOnNewInstallationsHandler(h func([]*multidevice.Installation)) func(c *config) error
func WithOnNewSharedSecret ¶
func WithOnNewSharedSecret(h func([]*sharedsecret.Secret)) func(c *config) error
func WithSendV1Messages ¶
func WithSendV1Messages() func(c *config) error
Types ¶
type Messenger ¶
type Messenger struct {
// contains filtered or unexported fields
}
Messenger is a entity managing chats and messages. It acts as a bridge between the application and encryption layers. It needs to expose an interface to manage installations because installations are managed by the user. Similarly, it needs to expose an interface to manage mailservers because they can also be managed by the user.
func NewMessenger ¶
func (*Messenger) AddMailserver ¶
NOT_IMPLEMENTED
func (*Messenger) DisableInstallation ¶
func (*Messenger) EnableInstallation ¶
func (*Messenger) Installations ¶
func (m *Messenger) Installations() ([]*multidevice.Installation, error)
func (*Messenger) RemoveMailserver ¶
NOT_IMPLEMENTED
func (*Messenger) SelectMailserver ¶
NOT_IMPLEMENTED
func (*Messenger) SetInstallationMetadata ¶
func (m *Messenger) SetInstallationMetadata(id string, data *multidevice.InstallationMetadata) error
Click to show internal directories.
Click to hide internal directories.