Documentation ¶
Index ¶
- Variables
- func IsEmailAddressAllowed(email string, allowedDomains []string) bool
- type DomainError
- type ServiceConfig
- type TeamService
- func (ts *TeamService) CreateTeam(team *model.Team) (*model.Team, error)
- func (ts *TeamService) DefaultChannelNames() []string
- func (ts *TeamService) GetAllowedDomains(user *model.User, team *model.Team) []string
- func (ts *TeamService) GetMember(teamID string, userID string) (*model.TeamMember, error)
- func (ts *TeamService) GetTeam(teamID string) (*model.Team, error)
- func (ts *TeamService) GetTeams(teamIDs []string) ([]*model.Team, error)
- func (ts *TeamService) IsTeamEmailAllowed(user *model.User, team *model.Team) bool
- func (ts *TeamService) JoinUserToTeam(team *model.Team, user *model.User) (*model.TeamMember, bool, error)
- func (ts *TeamService) PatchTeam(teamID string, patch *model.TeamPatch) (*model.Team, error)
- func (ts *TeamService) RemoveTeamMember(teamMember *model.TeamMember) error
- func (ts *TeamService) UpdateTeam(team *model.Team, opts UpdateOptions) (*model.Team, error)
- type UpdateOptions
- type Users
- type WebHub
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func IsEmailAddressAllowed ¶
Types ¶
type DomainError ¶
type DomainError struct {
Domain string
}
func (DomainError) Error ¶
func (DomainError) Error() string
type ServiceConfig ¶
type ServiceConfig struct { // Mandatory fields TeamStore store.TeamStore GroupStore store.GroupStore ChannelStore store.ChannelStore Users Users WebHub WebHub ConfigFn func() *model.Config LicenseFn func() *model.License }
ServiceConfig is used to initialize the TeamService.
type TeamService ¶
type TeamService struct {
// contains filtered or unexported fields
}
func New ¶
func New(c ServiceConfig) (*TeamService, error)
func (*TeamService) CreateTeam ¶
func (*TeamService) DefaultChannelNames ¶
func (ts *TeamService) DefaultChannelNames() []string
By default the list will be (not necessarily in this order):
['town-square', 'off-topic']
However, if TeamSettings.ExperimentalDefaultChannels contains a list of channels then that list will replace 'off-topic' and be included in the return results in addition to 'town-square'. For example:
['town-square', 'game-of-thrones', 'wow']
func (*TeamService) GetAllowedDomains ¶
func (*TeamService) GetMember ¶
func (ts *TeamService) GetMember(teamID string, userID string) (*model.TeamMember, error)
GetMember return the team member from the team.
func (*TeamService) GetTeams ¶
func (ts *TeamService) GetTeams(teamIDs []string) ([]*model.Team, error)
func (*TeamService) IsTeamEmailAllowed ¶
func (*TeamService) JoinUserToTeam ¶
func (ts *TeamService) JoinUserToTeam(team *model.Team, user *model.User) (*model.TeamMember, bool, error)
JoinUserToTeam adds a user to the team and it returns three values: 1. a pointer to the team member, if successful 2. a boolean: true if the user has a non-deleted team member for that team already, otherwise false. 3. a pointer to an AppError if something went wrong.
func (*TeamService) RemoveTeamMember ¶
func (ts *TeamService) RemoveTeamMember(teamMember *model.TeamMember) error
RemoveTeamMember removes the team member from the team. This method sends the websocket message before actually removing so the user being removed gets it.
func (*TeamService) UpdateTeam ¶
func (ts *TeamService) UpdateTeam(team *model.Team, opts UpdateOptions) (*model.Team, error)
type UpdateOptions ¶
type WebHub ¶
type WebHub interface {
Publish(message *model.WebSocketEvent)
}
WebHub is used to publish events, the name should be given appropriately while developing the websocket or clustering service