Documentation
¶
Index ¶
- type Config
- type Setup
- type UserEntity
- func (ue *UserEntity) AddChannelMember(channelId, userId string) error
- func (ue *UserEntity) AddTeamMember(teamId, userId string) error
- func (ue *UserEntity) AddTeamMemberFromInvite(token, inviteId string) error
- func (ue *UserEntity) AutoCompleteUsersInChannel(teamId, channelId, username string, limit int) (map[string]bool, error)
- func (ue *UserEntity) AutocompleteChannelsForTeam(teamId, name string) error
- func (ue *UserEntity) ClearUserData()
- func (ue *UserEntity) Connect() (<-chan error, error)
- func (ue *UserEntity) CreateChannel(channel *model.Channel) (string, error)
- func (ue *UserEntity) CreateDirectChannel(otherUserId string) (string, error)
- func (ue *UserEntity) CreateGroupChannel(memberIds []string) (string, error)
- func (ue *UserEntity) CreatePost(post *model.Post) (string, error)
- func (ue *UserEntity) CreateTeam(team *model.Team) (string, error)
- func (ue *UserEntity) CreateUser(user *model.User) (string, error)
- func (ue *UserEntity) DeleteReaction(reaction *model.Reaction) error
- func (ue *UserEntity) Disconnect() error
- func (ue *UserEntity) Events() <-chan *model.WebSocketEvent
- func (ue *UserEntity) FetchStaticAssets() error
- func (ue *UserEntity) GetAllTeams(page, perPage int) ([]string, error)
- func (ue *UserEntity) GetAnalytics() error
- func (ue *UserEntity) GetChannel(channelId string) error
- func (ue *UserEntity) GetChannelMember(channelId, userId string) error
- func (ue *UserEntity) GetChannelMembers(channelId string, page, perPage int) error
- func (ue *UserEntity) GetChannelMembersForUser(userId, teamId string) error
- func (ue *UserEntity) GetChannelStats(channelId string) error
- func (ue *UserEntity) GetChannelUnread(channelId string) (*model.ChannelUnread, error)
- func (ue *UserEntity) GetChannelsForTeam(teamId string, includeDeleted bool) error
- func (ue *UserEntity) GetChannelsForTeamForUser(teamId, userId string, includeDeleted bool) ([]*model.Channel, error)
- func (ue *UserEntity) GetClientLicense() error
- func (ue *UserEntity) GetClusterStatus() error
- func (ue *UserEntity) GetConfig() error
- func (ue *UserEntity) GetEmojiImage(emojiId string) error
- func (ue *UserEntity) GetEmojiList(page, perPage int) error
- func (ue *UserEntity) GetFileInfosForPost(postId string) ([]*model.FileInfo, error)
- func (ue *UserEntity) GetFilePreview(fileId string) error
- func (ue *UserEntity) GetFileThumbnail(fileId string) error
- func (ue *UserEntity) GetLogs(page, perPage int) error
- func (ue *UserEntity) GetMe() (string, error)
- func (ue *UserEntity) GetPinnedPosts(channelId string) (*model.PostList, error)
- func (ue *UserEntity) GetPluginStatuses() error
- func (ue *UserEntity) GetPostsAfter(channelId, postId string, page, perPage int) error
- func (ue *UserEntity) GetPostsAroundLastUnread(channelId string, limitBefore, limitAfter int) ([]string, error)
- func (ue *UserEntity) GetPostsBefore(channelId, postId string, page, perPage int) error
- func (ue *UserEntity) GetPostsForChannel(channelId string, page, perPage int) error
- func (ue *UserEntity) GetPostsSince(channelId string, time int64) ([]string, error)
- func (ue *UserEntity) GetPreferences() error
- func (ue *UserEntity) GetProfileImage() error
- func (ue *UserEntity) GetProfileImageForUser(userId string) error
- func (ue *UserEntity) GetPublicChannelsForTeam(teamId string, page, perPage int) error
- func (ue *UserEntity) GetReactions(postId string) error
- func (ue *UserEntity) GetRolesByNames(roleNames []string) ([]string, error)
- func (ue *UserEntity) GetTeam(teamId string) error
- func (ue *UserEntity) GetTeamMembers(teamId string, page, perPage int) error
- func (ue *UserEntity) GetTeamMembersForUser(userId string) error
- func (ue *UserEntity) GetTeamStats(teamId string) error
- func (ue *UserEntity) GetTeams() ([]string, error)
- func (ue *UserEntity) GetTeamsForUser(userId string) ([]string, error)
- func (ue *UserEntity) GetTeamsUnread(teamIdToExclude string) ([]*model.TeamUnread, error)
- func (ue *UserEntity) GetUserStatus() error
- func (ue *UserEntity) GetUsers(page, perPage int) ([]string, error)
- func (ue *UserEntity) GetUsersByIds(userIds []string) ([]string, error)
- func (ue *UserEntity) GetUsersByUsernames(usernames []string) ([]string, error)
- func (ue *UserEntity) GetUsersInChannel(channelId string, page, perPage int) error
- func (ue *UserEntity) GetUsersStatusesByIds(userIds []string) error
- func (ue *UserEntity) GetWebappPlugins() error
- func (ue *UserEntity) IsSysAdmin() (bool, error)
- func (ue *UserEntity) IsTeamAdmin() (bool, error)
- func (ue *UserEntity) Login() error
- func (ue *UserEntity) Logout() (bool, error)
- func (ue *UserEntity) PatchPost(postId string, patch *model.PostPatch) (string, error)
- func (ue *UserEntity) PatchUser(userId string, patch *model.UserPatch) error
- func (ue *UserEntity) RemoveTeamMember(teamId, userId string) error
- func (ue *UserEntity) RemoveUserFromChannel(channelId, userId string) (bool, error)
- func (ue *UserEntity) SaveReaction(reaction *model.Reaction) error
- func (ue *UserEntity) SearchChannels(teamId string, search *model.ChannelSearch) ([]*model.Channel, error)
- func (ue *UserEntity) SearchPosts(teamId, terms string, isOrSearch bool) (*model.PostList, error)
- func (ue *UserEntity) SearchUsers(search *model.UserSearch) ([]*model.User, error)
- func (ue *UserEntity) SendTypingEvent(channelId, parentId string) error
- func (ue *UserEntity) SetCurrentChannel(channel *model.Channel) error
- func (ue *UserEntity) SetCurrentTeam(team *model.Team) error
- func (ue *UserEntity) SetProfileImage(data []byte) error
- func (ue *UserEntity) SignUp(email, username, password string) error
- func (ue *UserEntity) Store() store.UserStore
- func (ue *UserEntity) UpdateConfig(cfg *model.Config) error
- func (ue *UserEntity) UpdatePreferences(pref *model.Preferences) error
- func (ue *UserEntity) UpdateTeam(team *model.Team) error
- func (ue *UserEntity) UpdateUser(user *model.User) error
- func (ue *UserEntity) UpdateUserRoles(userId, roles string) error
- func (ue *UserEntity) UploadFile(data []byte, channelId, filename string) (*model.FileUploadResponse, error)
- func (ue *UserEntity) ViewChannel(view *model.ChannelView) (*model.ChannelViewResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // The URL of the Mattermost web server. ServerURL string // The URL of the mattermost WebSocket server. WebSocketURL string // The username to be used by the entity. Username string // The email to be used by the entity. Email string // The password to be used by the entity. Password string }
Config holds necessary information required by a UserEntity.
type Setup ¶
type Setup struct { Store store.MutableUserStore Transport http.RoundTripper Metrics *performance.UserEntityMetrics }
type UserEntity ¶
type UserEntity struct {
// contains filtered or unexported fields
}
UserEntity is an implementation of the User interface which provides methods to interact with the Mattermost server.
func New ¶
func New(setup Setup, config Config) *UserEntity
New returns a new instance of a UserEntity.
func (*UserEntity) AddChannelMember ¶
func (ue *UserEntity) AddChannelMember(channelId, userId string) error
func (*UserEntity) AddTeamMember ¶
func (ue *UserEntity) AddTeamMember(teamId, userId string) error
func (*UserEntity) AddTeamMemberFromInvite ¶
func (ue *UserEntity) AddTeamMemberFromInvite(token, inviteId string) error
func (*UserEntity) AutoCompleteUsersInChannel ¶
func (*UserEntity) AutocompleteChannelsForTeam ¶
func (ue *UserEntity) AutocompleteChannelsForTeam(teamId, name string) error
AutocompleteChannelsForTeam returns an ordered list of channels for a given name.
func (*UserEntity) ClearUserData ¶
func (ue *UserEntity) ClearUserData()
func (*UserEntity) Connect ¶
func (ue *UserEntity) Connect() (<-chan error, error)
Connect creates a websocket connection to the server and starts listening for messages.
func (*UserEntity) CreateChannel ¶
func (ue *UserEntity) CreateChannel(channel *model.Channel) (string, error)
func (*UserEntity) CreateDirectChannel ¶
func (ue *UserEntity) CreateDirectChannel(otherUserId string) (string, error)
func (*UserEntity) CreateGroupChannel ¶
func (ue *UserEntity) CreateGroupChannel(memberIds []string) (string, error)
func (*UserEntity) CreatePost ¶
func (ue *UserEntity) CreatePost(post *model.Post) (string, error)
func (*UserEntity) CreateTeam ¶
func (ue *UserEntity) CreateTeam(team *model.Team) (string, error)
func (*UserEntity) CreateUser ¶
func (ue *UserEntity) CreateUser(user *model.User) (string, error)
func (*UserEntity) DeleteReaction ¶
func (ue *UserEntity) DeleteReaction(reaction *model.Reaction) error
func (*UserEntity) Disconnect ¶
func (ue *UserEntity) Disconnect() error
Disconnect closes the websocket connection.
func (*UserEntity) Events ¶
func (ue *UserEntity) Events() <-chan *model.WebSocketEvent
Events returns the WebSocket event chan for the controller to listen and react to events.
func (*UserEntity) FetchStaticAssets ¶
func (ue *UserEntity) FetchStaticAssets() error
FetchStaticAssets parses index.html and fetches static assets mentioned in link/script tags.
func (*UserEntity) GetAllTeams ¶
func (ue *UserEntity) GetAllTeams(page, perPage int) ([]string, error)
GetAllTeams returns all teams based on permissions.
func (*UserEntity) GetAnalytics ¶
func (ue *UserEntity) GetAnalytics() error
GetAnalytics fetches the system analytics.
func (*UserEntity) GetChannel ¶
func (ue *UserEntity) GetChannel(channelId string) error
func (*UserEntity) GetChannelMember ¶
func (ue *UserEntity) GetChannelMember(channelId, userId string) error
func (*UserEntity) GetChannelMembers ¶
func (ue *UserEntity) GetChannelMembers(channelId string, page, perPage int) error
func (*UserEntity) GetChannelMembersForUser ¶
func (ue *UserEntity) GetChannelMembersForUser(userId, teamId string) error
GetChannelMembersForUser gets all the channel members for a user on a team.
func (*UserEntity) GetChannelStats ¶
func (ue *UserEntity) GetChannelStats(channelId string) error
func (*UserEntity) GetChannelUnread ¶
func (ue *UserEntity) GetChannelUnread(channelId string) (*model.ChannelUnread, error)
func (*UserEntity) GetChannelsForTeam ¶
func (ue *UserEntity) GetChannelsForTeam(teamId string, includeDeleted bool) error
func (*UserEntity) GetChannelsForTeamForUser ¶
func (*UserEntity) GetClientLicense ¶
func (ue *UserEntity) GetClientLicense() error
GetClientLicense returns the client license in the old format.
func (*UserEntity) GetClusterStatus ¶
func (ue *UserEntity) GetClusterStatus() error
GetClusterStatus fetches the cluster status.
func (*UserEntity) GetConfig ¶
func (ue *UserEntity) GetConfig() error
func (*UserEntity) GetEmojiImage ¶
func (ue *UserEntity) GetEmojiImage(emojiId string) error
func (*UserEntity) GetEmojiList ¶
func (ue *UserEntity) GetEmojiList(page, perPage int) error
func (*UserEntity) GetFileInfosForPost ¶
func (ue *UserEntity) GetFileInfosForPost(postId string) ([]*model.FileInfo, error)
func (*UserEntity) GetFilePreview ¶
func (ue *UserEntity) GetFilePreview(fileId string) error
func (*UserEntity) GetFileThumbnail ¶
func (ue *UserEntity) GetFileThumbnail(fileId string) error
func (*UserEntity) GetLogs ¶
func (ue *UserEntity) GetLogs(page, perPage int) error
GetLogs fetches the logs.
func (*UserEntity) GetMe ¶
func (ue *UserEntity) GetMe() (string, error)
func (*UserEntity) GetPinnedPosts ¶
func (ue *UserEntity) GetPinnedPosts(channelId string) (*model.PostList, error)
func (*UserEntity) GetPluginStatuses ¶
func (ue *UserEntity) GetPluginStatuses() error
GetPluginStatuses fetches the plugin statuses.
func (*UserEntity) GetPostsAfter ¶
func (ue *UserEntity) GetPostsAfter(channelId, postId string, page, perPage int) error
func (*UserEntity) GetPostsAroundLastUnread ¶
func (ue *UserEntity) GetPostsAroundLastUnread(channelId string, limitBefore, limitAfter int) ([]string, error)
GetPostsAroundLastUnread returns the list of posts around last unread post by the current user in a channel.
func (*UserEntity) GetPostsBefore ¶
func (ue *UserEntity) GetPostsBefore(channelId, postId string, page, perPage int) error
func (*UserEntity) GetPostsForChannel ¶
func (ue *UserEntity) GetPostsForChannel(channelId string, page, perPage int) error
func (*UserEntity) GetPostsSince ¶
func (ue *UserEntity) GetPostsSince(channelId string, time int64) ([]string, error)
func (*UserEntity) GetPreferences ¶
func (ue *UserEntity) GetPreferences() error
func (*UserEntity) GetProfileImage ¶
func (ue *UserEntity) GetProfileImage() error
func (*UserEntity) GetProfileImageForUser ¶
func (ue *UserEntity) GetProfileImageForUser(userId string) error
func (*UserEntity) GetPublicChannelsForTeam ¶
func (ue *UserEntity) GetPublicChannelsForTeam(teamId string, page, perPage int) error
func (*UserEntity) GetReactions ¶
func (ue *UserEntity) GetReactions(postId string) error
func (*UserEntity) GetRolesByNames ¶
func (ue *UserEntity) GetRolesByNames(roleNames []string) ([]string, error)
func (*UserEntity) GetTeam ¶
func (ue *UserEntity) GetTeam(teamId string) error
func (*UserEntity) GetTeamMembers ¶
func (ue *UserEntity) GetTeamMembers(teamId string, page, perPage int) error
func (*UserEntity) GetTeamMembersForUser ¶
func (ue *UserEntity) GetTeamMembersForUser(userId string) error
func (*UserEntity) GetTeamStats ¶
func (ue *UserEntity) GetTeamStats(teamId string) error
func (*UserEntity) GetTeams ¶
func (ue *UserEntity) GetTeams() ([]string, error)
func (*UserEntity) GetTeamsForUser ¶
func (ue *UserEntity) GetTeamsForUser(userId string) ([]string, error)
func (*UserEntity) GetTeamsUnread ¶
func (ue *UserEntity) GetTeamsUnread(teamIdToExclude string) ([]*model.TeamUnread, error)
func (*UserEntity) GetUserStatus ¶
func (ue *UserEntity) GetUserStatus() error
func (*UserEntity) GetUsersByIds ¶
func (ue *UserEntity) GetUsersByIds(userIds []string) ([]string, error)
func (*UserEntity) GetUsersByUsernames ¶
func (ue *UserEntity) GetUsersByUsernames(usernames []string) ([]string, error)
func (*UserEntity) GetUsersInChannel ¶
func (ue *UserEntity) GetUsersInChannel(channelId string, page, perPage int) error
func (*UserEntity) GetUsersStatusesByIds ¶
func (ue *UserEntity) GetUsersStatusesByIds(userIds []string) error
func (*UserEntity) GetWebappPlugins ¶
func (ue *UserEntity) GetWebappPlugins() error
func (*UserEntity) IsSysAdmin ¶
func (ue *UserEntity) IsSysAdmin() (bool, error)
func (*UserEntity) IsTeamAdmin ¶
func (ue *UserEntity) IsTeamAdmin() (bool, error)
func (*UserEntity) Login ¶
func (ue *UserEntity) Login() error
func (*UserEntity) Logout ¶
func (ue *UserEntity) Logout() (bool, error)
func (*UserEntity) PatchUser ¶
func (ue *UserEntity) PatchUser(userId string, patch *model.UserPatch) error
func (*UserEntity) RemoveTeamMember ¶
func (ue *UserEntity) RemoveTeamMember(teamId, userId string) error
func (*UserEntity) RemoveUserFromChannel ¶
func (ue *UserEntity) RemoveUserFromChannel(channelId, userId string) (bool, error)
func (*UserEntity) SaveReaction ¶
func (ue *UserEntity) SaveReaction(reaction *model.Reaction) error
func (*UserEntity) SearchChannels ¶
func (ue *UserEntity) SearchChannels(teamId string, search *model.ChannelSearch) ([]*model.Channel, error)
func (*UserEntity) SearchPosts ¶
func (*UserEntity) SearchUsers ¶
func (ue *UserEntity) SearchUsers(search *model.UserSearch) ([]*model.User, error)
func (*UserEntity) SendTypingEvent ¶
func (ue *UserEntity) SendTypingEvent(channelId, parentId string) error
SendTypingEvent will push a user_typing event out to all connected users who are in the specified channel.
func (*UserEntity) SetCurrentChannel ¶
func (ue *UserEntity) SetCurrentChannel(channel *model.Channel) error
func (*UserEntity) SetCurrentTeam ¶
func (ue *UserEntity) SetCurrentTeam(team *model.Team) error
func (*UserEntity) SetProfileImage ¶
func (ue *UserEntity) SetProfileImage(data []byte) error
func (*UserEntity) SignUp ¶
func (ue *UserEntity) SignUp(email, username, password string) error
func (*UserEntity) Store ¶
func (ue *UserEntity) Store() store.UserStore
Store returns the underlying store of the user.
func (*UserEntity) UpdateConfig ¶
func (ue *UserEntity) UpdateConfig(cfg *model.Config) error
UpdateConfig updates the config with cfg.
func (*UserEntity) UpdatePreferences ¶
func (ue *UserEntity) UpdatePreferences(pref *model.Preferences) error
func (*UserEntity) UpdateTeam ¶
func (ue *UserEntity) UpdateTeam(team *model.Team) error
func (*UserEntity) UpdateUser ¶
func (ue *UserEntity) UpdateUser(user *model.User) error
func (*UserEntity) UpdateUserRoles ¶
func (ue *UserEntity) UpdateUserRoles(userId, roles string) error
func (*UserEntity) UploadFile ¶
func (ue *UserEntity) UploadFile(data []byte, channelId, filename string) (*model.FileUploadResponse, error)
func (*UserEntity) ViewChannel ¶
func (ue *UserEntity) ViewChannel(view *model.ChannelView) (*model.ChannelViewResponse, error)