Documentation ¶
Index ¶
- Variables
- type Container
- func (c *Container) Close() error
- func (c *Container) DeleteDevice(device *store.Device) error
- func (c *Container) GetAllDevices() ([]*store.Device, error)
- func (c *Container) GetDevice(jid types.JID) (*store.Device, error)
- func (c *Container) GetFirstDevice() (*store.Device, error)
- func (c *Container) NewDevice() *store.Device
- func (c *Container) PutDevice(device *store.Device) error
- type MongoStore
- func (s *MongoStore) DeleteIdentity(address string) error
- func (s *MongoStore) GenOnePreKey() (*keys.PreKey, error)
- func (s *MongoStore) GetSenderKey(group, user string) ([]byte, error)
- func (s *MongoStore) GetSession(address string) ([]byte, error)
- func (s *MongoStore) IsTrustedIdentity(address string, key [32]byte) (bool, error)
- func (s *MongoStore) PutIdentity(address string, key [32]byte) error
- func (s *MongoStore) PutSenderKey(group, user string, key []byte) error
- func (s *MongoStore) PutSession(address string, session []byte) error
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrInvalidLength = errors.New("invalid byte array length")
)
Functions ¶
This section is empty.
Types ¶
type Container ¶
type Container struct {
// contains filtered or unexported fields
}
Container wraps a MongoDB collection for managing waSocket sessions.
func (*Container) Close ¶
Close is a no-op for MongoDB, but can be used to close the client connection if needed.
func (*Container) DeleteDevice ¶
DeleteDevice deletes the given device from MongoDB.
func (*Container) GetAllDevices ¶
GetAllDevices finds all the devices in the MongoDB collection.
func (*Container) GetFirstDevice ¶
GetFirstDevice returns the first device found or creates a new one if none exist.
type MongoStore ¶
type MongoStore struct { JID string // contains filtered or unexported fields }
func NewMongoStore ¶
func NewMongoStore(client *mongo.Client, dbName, jid string) *MongoStore
func (*MongoStore) DeleteIdentity ¶
func (s *MongoStore) DeleteIdentity(address string) error
func (*MongoStore) GenOnePreKey ¶
func (s *MongoStore) GenOnePreKey() (*keys.PreKey, error)
func (*MongoStore) GetSenderKey ¶
func (s *MongoStore) GetSenderKey(group, user string) ([]byte, error)
func (*MongoStore) GetSession ¶
func (s *MongoStore) GetSession(address string) ([]byte, error)
func (*MongoStore) IsTrustedIdentity ¶
func (s *MongoStore) IsTrustedIdentity(address string, key [32]byte) (bool, error)
func (*MongoStore) PutIdentity ¶
func (s *MongoStore) PutIdentity(address string, key [32]byte) error
func (*MongoStore) PutSenderKey ¶
func (s *MongoStore) PutSenderKey(group, user string, key []byte) error
func (*MongoStore) PutSession ¶
func (s *MongoStore) PutSession(address string, session []byte) error
Click to show internal directories.
Click to hide internal directories.