Documentation ¶
Index ¶
- Constants
- func NewDailySummarySetting(inStore settingspanel.SettingStore, ...) settingspanel.Setting
- func NewNotificationsSetting(getCal func(string) MSCalendar) settingspanel.Setting
- func NewOAuth2App(env Env) oauth2connect.App
- func NewPostActionForEventResponse(eventID, response, url string) []*model.PostAction
- func NewSettingsPanel(bot bot.Bot, panelStore settingspanel.PanelStore, ...) settingspanel.Panel
- type Availability
- type Bot
- type Calendar
- type Client
- type DailySummary
- type Dependencies
- type Env
- type EventResponder
- type MSCalendar
- type NotificationProcessor
- type PluginAPI
- type Settings
- type StatusSyncJobSummary
- type Subscriptions
- type User
- type Users
- type WelcomeFlow
- type Welcomer
Constants ¶
View Source
const ( FieldSubject = "Subject" FieldBodyPreview = "BodyPreview" FieldImportance = "Importance" FieldDuration = "Duration" FieldWhen = "When" FieldLocation = "Location" FieldAttendees = "Attendees" FieldOrganizer = "Organizer" FieldResponseStatus = "ResponseStatus" )
View Source
const ( OptionYes = "Yes" OptionNotResponded = "Not responded" OptionNo = "No" OptionMaybe = "Maybe" )
View Source
const ( ResponseYes = "accepted" ResponseMaybe = "tentativelyAccepted" ResponseNo = "declined" ResponseNone = "notResponded" )
View Source
const BotWelcomeMessage = "Bot user connected to account %s."
View Source
const DailySummaryJobInterval = 15 * time.Minute
Run daily summary job every 15 minutes
View Source
const RemoteUserAlreadyConnected = "" /* 132-byte string literal not displayed */
View Source
const RemoteUserAlreadyConnectedNotFound = "%s account `%s` is already mapped to a Mattermost account, but the Mattermost user could not be found"
View Source
const (
StatusSyncJobInterval = 5 * time.Minute
)
View Source
const (
WelcomeMessage = `Welcome to the Microsoft Calendar plugin.
[Click here to link your account.](%s/oauth2/connect)`
)
Variables ¶
This section is empty.
Functions ¶
func NewDailySummarySetting ¶
func NewDailySummarySetting(inStore settingspanel.SettingStore, getTimezone func(userID string) (string, error)) settingspanel.Setting
func NewNotificationsSetting ¶
func NewNotificationsSetting(getCal func(string) MSCalendar) settingspanel.Setting
func NewOAuth2App ¶
func NewOAuth2App(env Env) oauth2connect.App
func NewPostActionForEventResponse ¶
func NewPostActionForEventResponse(eventID, response, url string) []*model.PostAction
func NewSettingsPanel ¶
func NewSettingsPanel(bot bot.Bot, panelStore settingspanel.PanelStore, settingStore settingspanel.SettingStore, settingsHandler, pluginURL string, getCal func(userID string) MSCalendar) settingspanel.Panel
Types ¶
type Availability ¶
type Availability interface { GetCalendarViews(users []*store.User) ([]*remote.ViewCalendarResponse, error) Sync(mattermostUserID string) (string, *StatusSyncJobSummary, error) SyncAll() (string, *StatusSyncJobSummary, error) }
type Calendar ¶
type Calendar interface { CreateCalendar(user *User, calendar *remote.Calendar) (*remote.Calendar, error) CreateEvent(user *User, event *remote.Event, mattermostUserIDs []string) (*remote.Event, error) DeleteCalendar(user *User, calendarID string) error FindMeetingTimes(user *User, meetingParams *remote.FindMeetingTimesParameters) (*remote.MeetingTimeSuggestionResults, error) GetCalendars(user *User) ([]*remote.Calendar, error) ViewCalendar(user *User, from, to time.Time) ([]*remote.Event, error) }
type DailySummary ¶
type DailySummary interface { GetDailySummaryForUser(user *User) (string, error) GetDailySummarySettingsForUser(user *User) (*store.DailySummaryUserSettings, error) SetDailySummaryPostTime(user *User, timeStr string) (*store.DailySummaryUserSettings, error) SetDailySummaryEnabled(user *User, enable bool) (*store.DailySummaryUserSettings, error) ProcessAllDailySummary(now time.Time) error }
type Dependencies ¶
type Dependencies struct { Logger bot.Logger PluginAPI PluginAPI Poster bot.Poster Remote remote.Remote Store store.Store SettingsPanel settingspanel.Panel IsAuthorizedAdmin func(string) (bool, error) Welcomer Welcomer Tracker tracker.Tracker }
Dependencies contains all API dependencies
type Env ¶
type Env struct { *config.Config *Dependencies }
type EventResponder ¶
type MSCalendar ¶
type MSCalendar interface { Availability Calendar EventResponder Subscriptions Users Welcomer Settings DailySummary }
func New ¶
func New(env Env, actingMattermostUserID string) MSCalendar
type NotificationProcessor ¶
type NotificationProcessor interface { Configure(Env) Enqueue(notifications ...*remote.Notification) error Quit() }
func NewNotificationProcessor ¶
func NewNotificationProcessor(env Env) NotificationProcessor
type PluginAPI ¶
type PluginAPI interface { GetMattermostUser(mattermostUserID string) (*model.User, error) GetMattermostUserByUsername(mattermostUsername string) (*model.User, error) GetMattermostUserStatus(mattermostUserID string) (*model.Status, error) GetMattermostUserStatusesByIds(mattermostUserIDs []string) ([]*model.Status, error) IsSysAdmin(mattermostUserID string) (bool, error) UpdateMattermostUserStatus(mattermostUserID, status string) (*model.Status, error) GetPost(postID string) (*model.Post, error) }
type StatusSyncJobSummary ¶
type Subscriptions ¶
type Subscriptions interface { CreateMyEventSubscription() (*store.Subscription, error) RenewMyEventSubscription() (*store.Subscription, error) DeleteOrphanedSubscription(ID string) error DeleteMyEventSubscription() error ListRemoteSubscriptions() ([]*remote.Subscription, error) LoadMyEventSubscription() (*store.Subscription, error) }
type Users ¶
type Users interface { GetActingUser() *User GetTimezone(user *User) (string, error) DisconnectUser(mattermostUserID string) error GetRemoteUser(mattermostUserID string) (*remote.User, error) IsAuthorizedAdmin(mattermostUserID string) (bool, error) GetUserSettings(user *User) (*store.Settings, error) }
type WelcomeFlow ¶
type WelcomeFlow struct {
// contains filtered or unexported fields
}
func NewWelcomeFlow ¶
func NewWelcomeFlow(bot bot.FlowController, welcomer Welcomer) *WelcomeFlow
func (*WelcomeFlow) FlowDone ¶
func (wf *WelcomeFlow) FlowDone(userID string)
func (*WelcomeFlow) Length ¶
func (wf *WelcomeFlow) Length() int
func (*WelcomeFlow) URL ¶
func (wf *WelcomeFlow) URL() string
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package mock_mscalendar is a generated GoMock package.
|
Package mock_mscalendar is a generated GoMock package. |
Package mock_plugin_api is a generated GoMock package.
|
Package mock_plugin_api is a generated GoMock package. |
Package mock_welcomer is a generated GoMock package.
|
Package mock_welcomer is a generated GoMock package. |
Click to show internal directories.
Click to hide internal directories.