rethinkdb

package
v0.0.0-...-2154053 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 25, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

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 (a *RethinkDbAdapter) ChangePassword(appid uint32, id t.Uid, password string) error

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

func (a *RethinkDbAdapter) GetPasswordHash(appid uint32, uname string) (t.Uid, []byte, error)

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 (a *RethinkDbAdapter) MessageGetAll(appId uint32, topic string, opts *t.BrowseOpt) ([]t.Message, error)

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

func (a *RethinkDbAdapter) SubsDelete(appid uint32, topic string, user t.Uid) error

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) TopicGet

func (a *RethinkDbAdapter) TopicGet(appid uint32, topic string) (*t.Topic, 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 (a *RethinkDbAdapter) TopicUpdateLastMsgTime(appid uint32, topic string, ts time.Time) error

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

func (a *RethinkDbAdapter) UserCreate(appId uint32, user *t.User) (error, bool)

UserCreate creates a new user. Returns error and bool - true if error is due to duplicate user name

func (*RethinkDbAdapter) UserDelete

func (a *RethinkDbAdapter) UserDelete(appId uint32, id t.Uid, soft bool) error

func (*RethinkDbAdapter) UserFind

func (a *RethinkDbAdapter) UserFind(appId uint32, params map[string]interface{}) ([]t.User, error)

func (*RethinkDbAdapter) UserGet

func (a *RethinkDbAdapter) UserGet(appid uint32, uid t.Uid) (*t.User, error)

UserGet fetches a single user by user id. If user is not found it returns (nil, nil)

func (*RethinkDbAdapter) UserGetAll

func (a *RethinkDbAdapter) UserGetAll(appId uint32, ids []t.Uid) ([]t.User, error)

func (*RethinkDbAdapter) UserUpdate

func (a *RethinkDbAdapter) UserUpdate(appid uint32, uid t.Uid, update map[string]interface{}) error

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL