Documentation ¶
Index ¶
- Constants
- type AppIface
- type InviteOption
- type ServerIface
- type Service
- func (scs *Service) Active() bool
- func (scs *Service) ForceSyncForRemote(rc *model.RemoteCluster)
- func (scs *Service) NotifyChannelChanged(channelId string)
- func (scs *Service) SendChannelInvite(channel *model.Channel, userId string, description string, ...) error
- func (scs *Service) Shutdown() error
- func (scs *Service) Start() error
- type SyncResponse
Constants ¶
const ( TopicSync = "sharedchannel_sync" TopicChannelInvite = "sharedchannel_invite" TopicUploadCreate = "sharedchannel_upload" MaxRetries = 3 MaxPostsPerSync = 12 // a bit more than one typical screenfull of posts NotifyRemoteOfflineThreshold = time.Second * 10 NotifyMinimumDelay = time.Second * 2 MaxUpsertRetries = 25 KeyRemoteUsername = "RemoteUsername" KeyRemoteEmail = "RemoteEmail" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppIface ¶
type AppIface interface { SendEphemeralPost(userId string, post *model.Post) *model.Post CreateChannelWithUser(channel *model.Channel, userId string) (*model.Channel, *model.AppError) GetOrCreateDirectChannel(userId, otherUserId string, channelOptions ...model.ChannelOption) (*model.Channel, *model.AppError) AddUserToChannel(user *model.User, channel *model.Channel, skipTeamMemberIntegrityCheck bool) (*model.ChannelMember, *model.AppError) AddUserToTeamByTeamId(teamId string, user *model.User) *model.AppError PermanentDeleteChannel(channel *model.Channel) *model.AppError CreatePost(post *model.Post, channel *model.Channel, triggerWebhooks bool, setOnline bool) (savedPost *model.Post, err *model.AppError) UpdatePost(post *model.Post, safeUpdate bool) (*model.Post, *model.AppError) DeletePost(postID, deleteByID string) (*model.Post, *model.AppError) SaveReactionForPost(reaction *model.Reaction) (*model.Reaction, *model.AppError) DeleteReactionForPost(reaction *model.Reaction) *model.AppError PatchChannelModerationsForChannel(channel *model.Channel, channelModerationsPatch []*model.ChannelModerationPatch) ([]*model.ChannelModeration, *model.AppError) CreateUploadSession(us *model.UploadSession) (*model.UploadSession, *model.AppError) FileReader(path string) (filestore.ReadCloseSeeker, *model.AppError) MentionsToTeamMembers(message, teamID string) model.UserMentionMap }
type InviteOption ¶
type InviteOption func(msg *channelInviteMsg)
func WithDirectParticipantID ¶
func WithDirectParticipantID(participantID string) InviteOption
type ServerIface ¶
type ServerIface interface { Config() *model.Config IsLeader() bool AddClusterLeaderChangedListener(listener func()) string RemoveClusterLeaderChangedListener(id string) GetStore() store.Store GetLogger() mlog.LoggerIFace GetRemoteClusterService() remotecluster.RemoteClusterServiceIFace }
Mocks can be re-generated with `make sharedchannel-mocks`.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service provides shared channel synchronization.
func NewSharedChannelService ¶
func NewSharedChannelService(server ServerIface, app AppIface) (*Service, error)
NewSharedChannelService creates a RemoteClusterService instance.
func (*Service) ForceSyncForRemote ¶
func (scs *Service) ForceSyncForRemote(rc *model.RemoteCluster)
ForceSyncForRemote causes all channels shared with the remote to be synchronized.
func (*Service) NotifyChannelChanged ¶
NotifyChannelChanged is called to indicate that a shared channel has been modified, thus triggering an update to all remote clusters.
func (*Service) SendChannelInvite ¶
func (scs *Service) SendChannelInvite(channel *model.Channel, userId string, description string, rc *model.RemoteCluster, options ...InviteOption) error
SendChannelInvite asynchronously sends a channel invite to a remote cluster. The remote cluster is expected to create a new channel with the same channel id, and respond with status OK. If an error occurs on the remote cluster then an ephemeral message is posted to in the channel for userId.