Documentation ¶
Index ¶
- Constants
- func Migrate(old *Database, new *Database)
- type Database
- type Message
- type MessageQuery
- func (mq *MessageQuery) GetAll(chat PortalKey) (messages []*Message)
- func (mq *MessageQuery) GetByMXID(mxid id.EventID) *Message
- func (mq *MessageQuery) GetByPID(chat PortalKey, pid string) *Message
- func (mq *MessageQuery) GetLastInChat(chat PortalKey) *Message
- func (mq *MessageQuery) GetLastInChatBefore(chat PortalKey, maxTimestamp int64) *Message
- func (mq *MessageQuery) New() *Message
- type Portal
- type PortalKey
- type PortalKeyWithMeta
- type PortalQuery
- func (pq *PortalQuery) FindPrivateChats(receiver pulsesms.PhoneNumber) []*Portal
- func (pq *PortalQuery) GetAll() []*Portal
- func (pq *PortalQuery) GetAllByPID(pid pulsesms.PhoneNumber) []*Portal
- func (pq *PortalQuery) GetByMXID(mxid id.RoomID) *Portal
- func (pq *PortalQuery) GetByPID(key PortalKey) *Portal
- func (pq *PortalQuery) New() *Portal
- type Puppet
- type PuppetQuery
- type SQLCryptoStore
- type SQLStateStore
- func (store *SQLStateStore) FindSharedRooms(userID id.UserID) (rooms []id.RoomID)
- func (store *SQLStateStore) GetMember(roomID id.RoomID, userID id.UserID) *event.MemberEventContent
- func (store *SQLStateStore) GetMembership(roomID id.RoomID, userID id.UserID) event.Membership
- func (store *SQLStateStore) GetPowerLevel(roomID id.RoomID, userID id.UserID) int
- func (store *SQLStateStore) GetPowerLevelRequirement(roomID id.RoomID, eventType event.Type) int
- func (store *SQLStateStore) GetPowerLevels(roomID id.RoomID) (levels *event.PowerLevelsEventContent)
- func (store *SQLStateStore) GetRoomMembers(roomID id.RoomID) map[id.UserID]*event.MemberEventContent
- func (store *SQLStateStore) HasPowerLevel(roomID id.RoomID, userID id.UserID, eventType event.Type) bool
- func (store *SQLStateStore) IsInRoom(roomID id.RoomID, userID id.UserID) bool
- func (store *SQLStateStore) IsInvited(roomID id.RoomID, userID id.UserID) bool
- func (store *SQLStateStore) IsMembership(roomID id.RoomID, userID id.UserID, allowedMemberships ...event.Membership) bool
- func (store *SQLStateStore) IsRegistered(userID id.UserID) bool
- func (store *SQLStateStore) MarkRegistered(userID id.UserID)
- func (store *SQLStateStore) SetMember(roomID id.RoomID, userID id.UserID, member *event.MemberEventContent)
- func (store *SQLStateStore) SetMembership(roomID id.RoomID, userID id.UserID, membership event.Membership)
- func (store *SQLStateStore) SetPowerLevels(roomID id.RoomID, levels *event.PowerLevelsEventContent)
- func (store *SQLStateStore) TryGetMember(roomID id.RoomID, userID id.UserID) (*event.MemberEventContent, bool)
- type Scannable
- type User
- func (user *User) CreateUserPortal(newKey PortalKeyWithMeta)
- func (user *User) GetInCommunityMap() map[PortalKey]bool
- func (user *User) GetPortalKeys() []PortalKey
- func (user *User) Insert()
- func (user *User) IsInPortal(key PortalKey) bool
- func (user *User) Scan(row Scannable) *User
- func (user *User) SetPortalKeys(newKeys []PortalKeyWithMeta) error
- func (user *User) Update()
- func (user *User) UpdateLastConnection()
- type UserQuery
Constants ¶
View Source
const VariableCountLimit = 512
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Database ¶
type Database struct { *sql.DB User *UserQuery Portal *PortalQuery Puppet *PuppetQuery Message *MessageQuery // contains filtered or unexported fields }
type Message ¶
type Message struct { Chat PortalKey PID pulsesms.MessageID // TODO: change to string? MXID id.EventID Sender pulsesms.PhoneNumber Timestamp int64 Sent bool Content string // TODO: richer type? compare to wa.ProtoMessage // contains filtered or unexported fields }
func (*Message) IsFakeMXID ¶
type MessageQuery ¶
type MessageQuery struct {
// contains filtered or unexported fields
}
func (*MessageQuery) GetAll ¶
func (mq *MessageQuery) GetAll(chat PortalKey) (messages []*Message)
func (*MessageQuery) GetByPID ¶
func (mq *MessageQuery) GetByPID(chat PortalKey, pid string) *Message
TODO accept pulsesms.MessageID (int)
func (*MessageQuery) GetLastInChat ¶
func (mq *MessageQuery) GetLastInChat(chat PortalKey) *Message
func (*MessageQuery) GetLastInChatBefore ¶
func (mq *MessageQuery) GetLastInChatBefore(chat PortalKey, maxTimestamp int64) *Message
func (*MessageQuery) New ¶
func (mq *MessageQuery) New() *Message
type Portal ¶
type Portal struct { Key PortalKey MXID id.RoomID Name string Topic string Avatar string AvatarURL id.ContentURI Encrypted bool // contains filtered or unexported fields }
func (*Portal) GetUserIDs ¶
type PortalKeyWithMeta ¶
type PortalQuery ¶
type PortalQuery struct {
// contains filtered or unexported fields
}
func (*PortalQuery) FindPrivateChats ¶
func (pq *PortalQuery) FindPrivateChats(receiver pulsesms.PhoneNumber) []*Portal
func (*PortalQuery) GetAll ¶
func (pq *PortalQuery) GetAll() []*Portal
func (*PortalQuery) GetAllByPID ¶
func (pq *PortalQuery) GetAllByPID(pid pulsesms.PhoneNumber) []*Portal
func (*PortalQuery) GetByPID ¶
func (pq *PortalQuery) GetByPID(key PortalKey) *Portal
func (*PortalQuery) New ¶
func (pq *PortalQuery) New() *Portal
type Puppet ¶
type PuppetQuery ¶
type PuppetQuery struct {
// contains filtered or unexported fields
}
func (*PuppetQuery) Get ¶
func (pq *PuppetQuery) Get(pid pulsesms.PhoneNumber) *Puppet
func (*PuppetQuery) GetAll ¶
func (pq *PuppetQuery) GetAll() (puppets []*Puppet)
func (*PuppetQuery) GetAllWithCustomMXID ¶
func (pq *PuppetQuery) GetAllWithCustomMXID() (puppets []*Puppet)
func (*PuppetQuery) GetByCustomMXID ¶
func (pq *PuppetQuery) GetByCustomMXID(mxid id.UserID) *Puppet
func (*PuppetQuery) New ¶
func (pq *PuppetQuery) New() *Puppet
type SQLCryptoStore ¶
type SQLCryptoStore struct { *crypto.SQLCryptoStore UserID id.UserID GhostIDFormat string }
func NewSQLCryptoStore ¶
func NewSQLCryptoStore(db *Database, userID id.UserID, ghostIDFormat string) *SQLCryptoStore
func (*SQLCryptoStore) FindDeviceID ¶
func (store *SQLCryptoStore) FindDeviceID() (deviceID id.DeviceID)
func (*SQLCryptoStore) GetRoomMembers ¶
type SQLStateStore ¶
type SQLStateStore struct { *appservice.TypingStateStore Typing map[id.RoomID]map[id.UserID]int64 // contains filtered or unexported fields }
func NewSQLStateStore ¶
func NewSQLStateStore(db *Database) *SQLStateStore
func (*SQLStateStore) FindSharedRooms ¶
func (store *SQLStateStore) FindSharedRooms(userID id.UserID) (rooms []id.RoomID)
func (*SQLStateStore) GetMember ¶
func (store *SQLStateStore) GetMember(roomID id.RoomID, userID id.UserID) *event.MemberEventContent
func (*SQLStateStore) GetMembership ¶
func (store *SQLStateStore) GetMembership(roomID id.RoomID, userID id.UserID) event.Membership
func (*SQLStateStore) GetPowerLevel ¶
func (*SQLStateStore) GetPowerLevelRequirement ¶
func (*SQLStateStore) GetPowerLevels ¶
func (store *SQLStateStore) GetPowerLevels(roomID id.RoomID) (levels *event.PowerLevelsEventContent)
func (*SQLStateStore) GetRoomMembers ¶
func (store *SQLStateStore) GetRoomMembers(roomID id.RoomID) map[id.UserID]*event.MemberEventContent
func (*SQLStateStore) HasPowerLevel ¶
func (*SQLStateStore) IsMembership ¶
func (store *SQLStateStore) IsMembership(roomID id.RoomID, userID id.UserID, allowedMemberships ...event.Membership) bool
func (*SQLStateStore) IsRegistered ¶
func (store *SQLStateStore) IsRegistered(userID id.UserID) bool
func (*SQLStateStore) MarkRegistered ¶
func (store *SQLStateStore) MarkRegistered(userID id.UserID)
func (*SQLStateStore) SetMember ¶
func (store *SQLStateStore) SetMember(roomID id.RoomID, userID id.UserID, member *event.MemberEventContent)
func (*SQLStateStore) SetMembership ¶
func (store *SQLStateStore) SetMembership(roomID id.RoomID, userID id.UserID, membership event.Membership)
func (*SQLStateStore) SetPowerLevels ¶
func (store *SQLStateStore) SetPowerLevels(roomID id.RoomID, levels *event.PowerLevelsEventContent)
func (*SQLStateStore) TryGetMember ¶
func (store *SQLStateStore) TryGetMember(roomID id.RoomID, userID id.UserID) (*event.MemberEventContent, bool)
type User ¶
type User struct { MXID id.UserID PID pulsesms.PhoneNumber ManagementRoom id.RoomID Session *pulsesms.KeyCredentials LastConnection int64 AccountID pulsesms.AccountID // contains filtered or unexported fields }
func (*User) CreateUserPortal ¶
func (user *User) CreateUserPortal(newKey PortalKeyWithMeta)
func (*User) GetInCommunityMap ¶
func (*User) GetPortalKeys ¶
func (*User) IsInPortal ¶
func (*User) SetPortalKeys ¶
func (user *User) SetPortalKeys(newKeys []PortalKeyWithMeta) error
func (*User) UpdateLastConnection ¶
func (user *User) UpdateLastConnection()
Source Files ¶
Click to show internal directories.
Click to hide internal directories.