Documentation ¶
Index ¶
- type RethinkDbAdapter
- func (a *RethinkDbAdapter) ChangePassword(appid uint32, id t.Uid, password string) error
- func (a *RethinkDbAdapter) Close() error
- func (a *RethinkDbAdapter) CreateDb(reset bool) error
- func (a *RethinkDbAdapter) GetPasswordHash(appid uint32, uname string) (t.Uid, []byte, error)
- func (a *RethinkDbAdapter) IsOpen() bool
- func (a *RethinkDbAdapter) MessageDelete(appId uint32, id t.Uid) error
- func (a *RethinkDbAdapter) MessageGetAll(appId uint32, topic string, opts *t.BrowseOpt) ([]t.Message, error)
- func (a *RethinkDbAdapter) MessageSave(appId uint32, msg *t.Message) error
- func (a *RethinkDbAdapter) Open(jsonconfig string, workerId int, uidkey []byte) error
- func (a *RethinkDbAdapter) SubsDelete(appid uint32, topic string, user t.Uid) error
- func (a *RethinkDbAdapter) SubsForTopic(appId uint32, topic string, opts *t.BrowseOpt) ([]t.Subscription, error)
- func (a *RethinkDbAdapter) SubsForUser(appid uint32, forUser t.Uid, opts *t.BrowseOpt) ([]t.Subscription, error)
- func (a *RethinkDbAdapter) SubsLastSeen(appid uint32, topic string, user t.Uid, lastSeen map[string]time.Time) error
- func (a *RethinkDbAdapter) SubsUpdate(appid uint32, topic string, user t.Uid, update map[string]interface{}) error
- func (a *RethinkDbAdapter) SubscriptionGet(appid uint32, topic string, user t.Uid) (*t.Subscription, error)
- func (a *RethinkDbAdapter) TopicCreate(appId uint32, topic *t.Topic) error
- func (a *RethinkDbAdapter) TopicCreateP2P(appId uint32, initiator, invited *t.Subscription) error
- func (a *RethinkDbAdapter) TopicDelete(appId uint32, userDbId, topic string) error
- func (a *RethinkDbAdapter) TopicGet(appid uint32, topic string) (*t.Topic, error)
- func (a *RethinkDbAdapter) TopicShare(appid uint32, shares []t.Subscription) (int, error)
- func (a *RethinkDbAdapter) TopicUpdate(appid uint32, topic string, update map[string]interface{}) error
- func (a *RethinkDbAdapter) TopicUpdateLastMsgTime(appid uint32, topic string, ts time.Time) error
- func (a *RethinkDbAdapter) TopicsForUser(appid uint32, uid t.Uid, opts *t.BrowseOpt) ([]t.Subscription, error)
- func (a *RethinkDbAdapter) UpdateLastSeen(appid uint32, topic string, user t.Uid, tag string, when time.Time) error
- func (a *RethinkDbAdapter) UserCreate(appId uint32, user *t.User) (error, bool)
- func (a *RethinkDbAdapter) UserDelete(appId uint32, id t.Uid, soft bool) error
- func (a *RethinkDbAdapter) UserFind(appId uint32, params map[string]interface{}) ([]t.User, error)
- func (a *RethinkDbAdapter) UserGet(appid uint32, uid t.Uid) (*t.User, error)
- func (a *RethinkDbAdapter) UserGetAll(appId uint32, ids []t.Uid) ([]t.User, error)
- func (a *RethinkDbAdapter) UserUpdate(appid uint32, uid t.Uid, update map[string]interface{}) error
- func (a *RethinkDbAdapter) UserUpdateStatus(appid uint32, uid t.Uid, status interface{}) error
- func (a *RethinkDbAdapter) UsersForTopic(appid uint32, topic string, opts *t.BrowseOpt) ([]t.Subscription, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RethinkDbAdapter ¶
type RethinkDbAdapter struct {
// contains filtered or unexported fields
}
func (*RethinkDbAdapter) ChangePassword ¶
func (*RethinkDbAdapter) Close ¶
func (a *RethinkDbAdapter) Close() error
Close closes the underlying database connection
func (*RethinkDbAdapter) CreateDb ¶
func (a *RethinkDbAdapter) CreateDb(reset bool) error
CreateDb initializes the storage. If reset is true, the database is first deleted losing all the data.
func (*RethinkDbAdapter) GetPasswordHash ¶
Users
func (*RethinkDbAdapter) IsOpen ¶
func (a *RethinkDbAdapter) IsOpen() bool
IsOpen returns true if connection to database has been established. It does not check if connection is actually live.
func (*RethinkDbAdapter) MessageDelete ¶
func (a *RethinkDbAdapter) MessageDelete(appId uint32, id t.Uid) error
func (*RethinkDbAdapter) MessageGetAll ¶
func (*RethinkDbAdapter) MessageSave ¶
func (a *RethinkDbAdapter) MessageSave(appId uint32, msg *t.Message) error
Messages
func (*RethinkDbAdapter) Open ¶
func (a *RethinkDbAdapter) Open(jsonconfig string, workerId int, uidkey []byte) error
Open initializes rethinkdb session
func (*RethinkDbAdapter) SubsDelete ¶
Delete a subscription.
func (*RethinkDbAdapter) SubsForTopic ¶
func (a *RethinkDbAdapter) SubsForTopic(appId uint32, topic string, opts *t.BrowseOpt) ([]t.Subscription, error)
SubsForTopic fetches all subsciptions for a topic.
func (*RethinkDbAdapter) SubsForUser ¶
func (a *RethinkDbAdapter) SubsForUser(appid uint32, forUser t.Uid, opts *t.BrowseOpt) ([]t.Subscription, error)
SubsForUser loads a list of user's subscriptions to topics
func (*RethinkDbAdapter) SubsLastSeen ¶
func (a *RethinkDbAdapter) SubsLastSeen(appid uint32, topic string, user t.Uid, lastSeen map[string]time.Time) error
Update time when the user was last attached to the topic
func (*RethinkDbAdapter) SubsUpdate ¶
func (a *RethinkDbAdapter) SubsUpdate(appid uint32, topic string, user t.Uid, update map[string]interface{}) error
Update a single subscription.
func (*RethinkDbAdapter) SubscriptionGet ¶
func (a *RethinkDbAdapter) SubscriptionGet(appid uint32, topic string, user t.Uid) (*t.Subscription, error)
Get a subscription of a user to a topic
func (*RethinkDbAdapter) TopicCreate ¶
func (a *RethinkDbAdapter) TopicCreate(appId uint32, topic *t.Topic) error
TopicCreate creates a topic from template
func (*RethinkDbAdapter) TopicCreateP2P ¶
func (a *RethinkDbAdapter) TopicCreateP2P(appId uint32, initiator, invited *t.Subscription) error
TopicCreateP2P given two users creates a p2p topic
func (*RethinkDbAdapter) TopicDelete ¶
func (a *RethinkDbAdapter) TopicDelete(appId uint32, userDbId, topic string) error
func (*RethinkDbAdapter) TopicShare ¶
func (a *RethinkDbAdapter) TopicShare(appid uint32, shares []t.Subscription) (int, error)
func (*RethinkDbAdapter) TopicUpdate ¶
func (a *RethinkDbAdapter) TopicUpdate(appid uint32, topic string, update map[string]interface{}) error
func (*RethinkDbAdapter) TopicUpdateLastMsgTime ¶
func (*RethinkDbAdapter) TopicsForUser ¶
func (a *RethinkDbAdapter) TopicsForUser(appid uint32, uid t.Uid, opts *t.BrowseOpt) ([]t.Subscription, error)
TopicsForUser loads user's topics and contacts
func (*RethinkDbAdapter) UpdateLastSeen ¶
func (a *RethinkDbAdapter) UpdateLastSeen(appid uint32, topic string, user t.Uid, tag string, when time.Time) error
UpdateLastSeen records the time when a session with a given device ID detached from a topic
func (*RethinkDbAdapter) UserCreate ¶
UserCreate creates a new user. Returns error and bool - true if error is due to duplicate user name
func (*RethinkDbAdapter) UserDelete ¶
func (*RethinkDbAdapter) UserGet ¶
UserGet fetches a single user by user id. If user is not found it returns (nil, nil)
func (*RethinkDbAdapter) UserGetAll ¶
func (*RethinkDbAdapter) UserUpdate ¶
func (*RethinkDbAdapter) UserUpdateStatus ¶
func (a *RethinkDbAdapter) UserUpdateStatus(appid uint32, uid t.Uid, status interface{}) error
func (*RethinkDbAdapter) UsersForTopic ¶
func (a *RethinkDbAdapter) UsersForTopic(appid uint32, topic string, opts *t.BrowseOpt) ([]t.Subscription, error)
UsersForTopic loads users subscribed to the given topic