Documentation ¶
Index ¶
- type Attachment
- type AttachmentQuery
- func (aq *AttachmentQuery) GetAllBySlackMessageID(key PortalKey, slackMessageID string) []*Attachment
- func (aq *AttachmentQuery) GetByMatrixID(key PortalKey, matrixEventID id.EventID) *Attachment
- func (aq *AttachmentQuery) GetBySlackFileID(key PortalKey, slackMessageID, slackFileID string) *Attachment
- func (aq *AttachmentQuery) GetLast(key PortalKey) *Attachment
- func (aq *AttachmentQuery) New() *Attachment
- type BackfillQuery
- func (bq *BackfillQuery) GetBackfillState(portalKey *PortalKey) (backfillState *BackfillState)
- func (bq *BackfillQuery) GetNextUnfinishedBackfillState() (backfillState *BackfillState)
- func (bq *BackfillQuery) NewBackfillState(portalKey *PortalKey) *BackfillState
- func (b *BackfillQuery) UndispatchAll()
- type BackfillState
- type ChannelType
- type Database
- type Emoji
- type EmojiQuery
- type Message
- type MessageQuery
- func (mq *MessageQuery) GetAll(key PortalKey) []*Message
- func (mq *MessageQuery) GetByMatrixID(key PortalKey, matrixID id.EventID) *Message
- func (mq *MessageQuery) GetBySlackID(key PortalKey, slackID string) *Message
- func (mq *MessageQuery) GetFirst(key PortalKey) *Message
- func (mq *MessageQuery) GetLast(key PortalKey) *Message
- func (mq *MessageQuery) GetLastInThread(key PortalKey, slackThreadId string) *Message
- func (mq *MessageQuery) New() *Message
- type Portal
- type PortalKey
- type PortalQuery
- func (pq *PortalQuery) FindPrivateChatsWith(id string) []*Portal
- func (pq *PortalQuery) GetAll() []*Portal
- func (pq *PortalQuery) GetAllForUserTeam(utk UserTeamKey) []*Portal
- func (pq *PortalQuery) GetByID(key PortalKey) *Portal
- func (pq *PortalQuery) GetByMXID(mxid id.RoomID) *Portal
- func (pq *PortalQuery) New() *Portal
- type Puppet
- type PuppetQuery
- func (pq *PuppetQuery) Get(teamID, userID string) *Puppet
- func (pq *PuppetQuery) GetAll() []*Puppet
- func (pq *PuppetQuery) GetAllForTeam(teamID string) []*Puppet
- func (pq *PuppetQuery) GetAllWithCustomMXID() []*Puppet
- func (pq *PuppetQuery) GetByCustomMXID(mxid id.UserID) *Puppet
- func (pq *PuppetQuery) New() *Puppet
- type Reaction
- type ReactionQuery
- func (rq *ReactionQuery) GetAllByMatrixID(key PortalKey, matrixEventID id.EventID) []*Reaction
- func (rq *ReactionQuery) GetByMatrixID(key PortalKey, matrixEventID id.EventID) *Reaction
- func (rq *ReactionQuery) GetBySlackID(key PortalKey, slackAuthor, slackMessageID, slackName string) *Reaction
- func (rq *ReactionQuery) New() *Reaction
- type TeamInfo
- type TeamInfoQuery
- type User
- type UserQuery
- type UserTeam
- type UserTeamKey
- type UserTeamQuery
- func (utq *UserTeamQuery) GetAllByMXIDWithToken(userID id.UserID) []*UserTeam
- func (utq *UserTeamQuery) GetAllBySlackTeamID(teamID string) []*UserTeam
- func (utq *UserTeamQuery) GetBySlackDomain(userID id.UserID, email, domain string) *UserTeam
- func (utq *UserTeamQuery) GetFirstUserTeamForPortal(portal *PortalKey) *UserTeam
- func (utq *UserTeamQuery) New() *UserTeam
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Attachment ¶
type Attachment struct { Channel PortalKey SlackMessageID string SlackFileID string MatrixEventID id.EventID SlackThreadID string // contains filtered or unexported fields }
func (*Attachment) Delete ¶
func (a *Attachment) Delete()
func (*Attachment) Insert ¶
func (a *Attachment) Insert(txn dbutil.Transaction)
func (*Attachment) Scan ¶
func (a *Attachment) Scan(row dbutil.Scannable) *Attachment
type AttachmentQuery ¶
type AttachmentQuery struct {
// contains filtered or unexported fields
}
func (*AttachmentQuery) GetAllBySlackMessageID ¶
func (aq *AttachmentQuery) GetAllBySlackMessageID(key PortalKey, slackMessageID string) []*Attachment
func (*AttachmentQuery) GetByMatrixID ¶
func (aq *AttachmentQuery) GetByMatrixID(key PortalKey, matrixEventID id.EventID) *Attachment
func (*AttachmentQuery) GetBySlackFileID ¶
func (aq *AttachmentQuery) GetBySlackFileID(key PortalKey, slackMessageID, slackFileID string) *Attachment
func (*AttachmentQuery) GetLast ¶
func (aq *AttachmentQuery) GetLast(key PortalKey) *Attachment
func (*AttachmentQuery) New ¶
func (aq *AttachmentQuery) New() *Attachment
type BackfillQuery ¶
type BackfillQuery struct {
// contains filtered or unexported fields
}
func (*BackfillQuery) GetBackfillState ¶
func (bq *BackfillQuery) GetBackfillState(portalKey *PortalKey) (backfillState *BackfillState)
func (*BackfillQuery) GetNextUnfinishedBackfillState ¶
func (bq *BackfillQuery) GetNextUnfinishedBackfillState() (backfillState *BackfillState)
func (*BackfillQuery) NewBackfillState ¶
func (bq *BackfillQuery) NewBackfillState(portalKey *PortalKey) *BackfillState
func (*BackfillQuery) UndispatchAll ¶
func (b *BackfillQuery) UndispatchAll()
Undispatch backfills so they can be retried in case the bridge crashed/was stopped during backfill Sent messages are tracked in the message and portal tables so this shouldn't lead to duplicate backfills
type BackfillState ¶
type BackfillState struct { // Fields Portal *PortalKey Dispatched bool BackfillComplete bool MessageCount int ImmediateComplete bool // contains filtered or unexported fields }
func (*BackfillState) Scan ¶
func (b *BackfillState) Scan(row dbutil.Scannable) *BackfillState
func (*BackfillState) SetDispatched ¶
func (b *BackfillState) SetDispatched(d bool)
func (*BackfillState) Upsert ¶
func (b *BackfillState) Upsert()
type ChannelType ¶
type ChannelType int64
const ( ChannelTypeUnknown ChannelType = iota ChannelTypeChannel ChannelTypeDM ChannelTypeGroupDM )
func (ChannelType) String ¶
func (ct ChannelType) String() string
type Database ¶
type Database struct { *dbutil.Database User *UserQuery UserTeam *UserTeamQuery Portal *PortalQuery Puppet *PuppetQuery Message *MessageQuery Reaction *ReactionQuery Attachment *AttachmentQuery TeamInfo *TeamInfoQuery Backfill *BackfillQuery Emoji *EmojiQuery }
type Emoji ¶
type Emoji struct { SlackID string SlackTeam string Alias string ImageURL id.ContentURI // contains filtered or unexported fields }
func (*Emoji) Upsert ¶
func (e *Emoji) Upsert(txn dbutil.Transaction)
type EmojiQuery ¶
type EmojiQuery struct {
// contains filtered or unexported fields
}
func (*EmojiQuery) GetByMXC ¶
func (eq *EmojiQuery) GetByMXC(mxc id.ContentURI) *Emoji
func (*EmojiQuery) GetBySlackID ¶
func (eq *EmojiQuery) GetBySlackID(slackID string, slackTeam string) *Emoji
func (*EmojiQuery) GetEmojiCount ¶
func (eq *EmojiQuery) GetEmojiCount(slackTeam string) (count int, err error)
func (*EmojiQuery) New ¶
func (eq *EmojiQuery) New() *Emoji
type Message ¶
type Message struct { Channel PortalKey SlackID string MatrixID id.EventID SlackThreadID string AuthorID string // contains filtered or unexported fields }
func (*Message) Insert ¶
func (m *Message) Insert(txn dbutil.Transaction)
type MessageQuery ¶
type MessageQuery struct {
// contains filtered or unexported fields
}
func (*MessageQuery) GetAll ¶
func (mq *MessageQuery) GetAll(key PortalKey) []*Message
func (*MessageQuery) GetByMatrixID ¶
func (mq *MessageQuery) GetByMatrixID(key PortalKey, matrixID id.EventID) *Message
func (*MessageQuery) GetBySlackID ¶
func (mq *MessageQuery) GetBySlackID(key PortalKey, slackID string) *Message
func (*MessageQuery) GetFirst ¶
func (mq *MessageQuery) GetFirst(key PortalKey) *Message
func (*MessageQuery) GetLast ¶
func (mq *MessageQuery) GetLast(key PortalKey) *Message
func (*MessageQuery) GetLastInThread ¶
func (mq *MessageQuery) GetLastInThread(key PortalKey, slackThreadId string) *Message
func (*MessageQuery) New ¶
func (mq *MessageQuery) New() *Message
type Portal ¶
type Portal struct { Key PortalKey MXID id.RoomID Type ChannelType DMUserID string PlainName string Name string NameSet bool Topic string TopicSet bool Encrypted bool Avatar string AvatarURL id.ContentURI AvatarSet bool FirstEventID id.EventID NextBatchID id.BatchID FirstSlackID string InSpace bool // contains filtered or unexported fields }
func (*Portal) DeleteUser ¶
func (p *Portal) DeleteUser(utk UserTeamKey)
func (*Portal) InsertUser ¶
func (p *Portal) InsertUser(utk UserTeamKey)
func (*Portal) Update ¶
func (p *Portal) Update(txn dbutil.Transaction)
type PortalKey ¶
func NewPortalKey ¶
type PortalQuery ¶
type PortalQuery struct {
// contains filtered or unexported fields
}
func (*PortalQuery) FindPrivateChatsWith ¶
func (pq *PortalQuery) FindPrivateChatsWith(id string) []*Portal
func (*PortalQuery) GetAll ¶
func (pq *PortalQuery) GetAll() []*Portal
func (*PortalQuery) GetAllForUserTeam ¶
func (pq *PortalQuery) GetAllForUserTeam(utk UserTeamKey) []*Portal
func (*PortalQuery) GetByID ¶
func (pq *PortalQuery) GetByID(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(teamID, userID string) *Puppet
func (*PuppetQuery) GetAll ¶
func (pq *PuppetQuery) GetAll() []*Puppet
func (*PuppetQuery) GetAllForTeam ¶
func (pq *PuppetQuery) GetAllForTeam(teamID string) []*Puppet
func (*PuppetQuery) GetAllWithCustomMXID ¶
func (pq *PuppetQuery) GetAllWithCustomMXID() []*Puppet
func (*PuppetQuery) GetByCustomMXID ¶
func (pq *PuppetQuery) GetByCustomMXID(mxid id.UserID) *Puppet
func (*PuppetQuery) New ¶
func (pq *PuppetQuery) New() *Puppet
type Reaction ¶
type Reaction struct { Channel PortalKey SlackMessageID string MatrixEventID id.EventID // The slack ID of who create this reaction AuthorID string MatrixName string MatrixURL string // Used for custom emoji SlackName string // The id or unicode of the emoji for slack // contains filtered or unexported fields }
func (*Reaction) Insert ¶
func (r *Reaction) Insert(txn dbutil.Transaction)
type ReactionQuery ¶
type ReactionQuery struct {
// contains filtered or unexported fields
}
func (*ReactionQuery) GetAllByMatrixID ¶
func (rq *ReactionQuery) GetAllByMatrixID(key PortalKey, matrixEventID id.EventID) []*Reaction
func (*ReactionQuery) GetByMatrixID ¶
func (rq *ReactionQuery) GetByMatrixID(key PortalKey, matrixEventID id.EventID) *Reaction
func (*ReactionQuery) GetBySlackID ¶
func (rq *ReactionQuery) GetBySlackID(key PortalKey, slackAuthor, slackMessageID, slackName string) *Reaction
func (*ReactionQuery) New ¶
func (rq *ReactionQuery) New() *Reaction
type TeamInfo ¶
type TeamInfoQuery ¶
type TeamInfoQuery struct {
// contains filtered or unexported fields
}
func (*TeamInfoQuery) GetBySlackTeam ¶
func (tiq *TeamInfoQuery) GetBySlackTeam(team string) *TeamInfo
func (*TeamInfoQuery) New ¶
func (tiq *TeamInfoQuery) New() *TeamInfo
type User ¶
type User struct { MXID id.UserID ManagementRoom id.RoomID SpaceRoom id.RoomID TeamsLock sync.Mutex Teams map[string]*UserTeam // contains filtered or unexported fields }
func (*User) GetLoggedInTeams ¶
func (*User) TeamLoggedIn ¶
type UserQuery ¶
type UserQuery struct {
// contains filtered or unexported fields
}
func (*UserQuery) GetBySlackID ¶
type UserTeam ¶
type UserTeam struct { Key UserTeamKey SlackEmail string TeamName string Token string CookieToken string InSpace bool Client *slack.Client RTM *slack.RTM // contains filtered or unexported fields }
func (*UserTeam) GetRemoteID ¶
func (*UserTeam) GetRemoteName ¶
func (*UserTeam) IsConnected ¶
func (*UserTeam) IsLoggedIn ¶
type UserTeamKey ¶
func (UserTeamKey) String ¶
func (utk UserTeamKey) String() string
type UserTeamQuery ¶
type UserTeamQuery struct {
// contains filtered or unexported fields
}
func (*UserTeamQuery) GetAllByMXIDWithToken ¶
func (utq *UserTeamQuery) GetAllByMXIDWithToken(userID id.UserID) []*UserTeam
func (*UserTeamQuery) GetAllBySlackTeamID ¶
func (utq *UserTeamQuery) GetAllBySlackTeamID(teamID string) []*UserTeam
func (*UserTeamQuery) GetBySlackDomain ¶
func (utq *UserTeamQuery) GetBySlackDomain(userID id.UserID, email, domain string) *UserTeam
func (*UserTeamQuery) GetFirstUserTeamForPortal ¶
func (utq *UserTeamQuery) GetFirstUserTeamForPortal(portal *PortalKey) *UserTeam
func (*UserTeamQuery) New ¶
func (utq *UserTeamQuery) New() *UserTeam
Source Files ¶
Click to show internal directories.
Click to hide internal directories.