userentity

package
v0.3.0-alpha Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

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 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(store store.MutableUserStore, 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) AutocompleteChannelsForTeam

func (ue *UserEntity) AutocompleteChannelsForTeam(teamId, name string) error

AutocompleteChannelsForTeam returns an ordered list of channels for a given name.

func (*UserEntity) Cleanup

func (ue *UserEntity) Cleanup()

Cleanup is a one time method used to close any open resources that the user might have kept open throughout its lifetime. After calling cleanup, the user might not be used any more. This is different from the Connect/Disconnect methods which can be called multiple times.

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) 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 (ue *UserEntity) GetChannelsForTeamForUser(teamId, userId string, includeDeleted bool) ([]*model.Channel, error)

func (*UserEntity) GetClientLicense

func (ue *UserEntity) GetClientLicense() error

GetClientLicense returns the client license in the old format.

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

func (ue *UserEntity) GetMe() (string, error)

func (*UserEntity) GetPinnedPosts

func (ue *UserEntity) GetPinnedPosts(channelId string) (*model.PostList, error)

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

func (ue *UserEntity) GetUsers(page, perPage int) 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) PatchPost

func (ue *UserEntity) PatchPost(postId string, patch *model.PostPatch) (string, 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 (ue *UserEntity) SearchPosts(teamId, terms string, isOrSearch bool) (*model.PostList, error)

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

Jump to

Keyboard shortcuts

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