Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client interface {
GetUser(userID string) (*model.User, error)
GetPost(postID string) (*model.Post, error)
AddReaction(*model.Reaction) error
GetPostThread(postID string) (*model.PostList, error)
GetPostsSince(channelID string, since int64) (*model.PostList, error)
GetPostsBefore(channelID, postID string, page, perPage int) (*model.PostList, error)
CreatePost(post *model.Post) error
UpdatePost(post *model.Post) error
DM(senderID, receiverID string, post *model.Post) error
GetChannel(channelID string) (*model.Channel, error)
GetDirectChannel(userID1, userID2 string) (*model.Channel, error)
PublishWebSocketEvent(event string, payload map[string]interface{}, broadcast *model.WebsocketBroadcast)
GetConfig() *model.Config
LogError(msg string, keyValuePairs ...interface{})
LogWarn(msg string, keyValuePairs ...interface{})
KVGet(key string, value interface{}) error
KVSet(key string, value interface{}) error
KVDelete(key string) error
GetUserByUsername(username string) (*model.User, error)
GetUserStatus(userID string) (*model.Status, error)
HasPermissionTo(userID string, permission *model.Permission) bool
GetPluginStatus(pluginID string) (*model.PluginStatus, error)
PluginHTTP(req *http.Request) *http.Response
LogDebug(msg string, keyValuePairs ...interface{})
GetChannelByName(teamID, name string, includeDeleted bool) (*model.Channel, error)
HasPermissionToChannel(userID, channelID string, permission *model.Permission) bool
GetFileInfo(fileID string) (*model.FileInfo, error)
GetFile(fileID string) (io.ReadCloser, error)
SendEphemeralPost(userID string, post *model.Post)
}
type DBClient ¶
func NewDBClient ¶
NewDBClient creates the DB part of the client, only supported on postgres, panics on failures.
func (*DBClient) Builder ¶
func (db *DBClient) Builder() sq.StatementBuilderType
type ThreadData ¶
func GetMetadataForPosts ¶
func GetMetadataForPosts(client Client, posts *model.PostList) (*ThreadData, error)
func GetThreadData ¶
func GetThreadData(client Client, postID string) (*ThreadData, error)
func (*ThreadData) CutoffBeforePostID ¶
func (t *ThreadData) CutoffBeforePostID(postID string)
Click to show internal directories.
Click to hide internal directories.