service

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: May 18, 2022 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// UserEventHandlerCronSpec @every 1m
	UserEventHandlerCronSpec = "CRON_TZ=UTC */1 * * * *"
	// UserEventUpdaterCronSpec @every 10m
	UserEventUpdaterCronSpec = "CRON_TZ=UTC */10 * * * *"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Calendar

type Calendar struct {
	// contains filtered or unexported fields
}

func NewCalendarService

func NewCalendarService(
	logger *util.Logger,
	plugin plugin.API,
	serverUrl string,
	credentialsRepo *repository.CredentialsRepo) *Calendar

func (*Calendar) FindCalendars

func (c *Calendar) FindCalendars(userId string) ([]caldav.Calendar, error)

func (*Calendar) GetCalendarHomeSet

func (c *Calendar) GetCalendarHomeSet(userId string) (string, error)

func (*Calendar) GetTodayDateTimes

func (c *Calendar) GetTodayDateTimes(userId string) (time.Time, time.Time)

func (*Calendar) LoadCalendar

func (c *Calendar) LoadCalendar(userId string) ([]dto.Event, error)

func (*Calendar) LoadCalendarUpdates

func (c *Calendar) LoadCalendarUpdates(userId string) ([]dto.Event, []dto.Event)

func (*Calendar) LoadEvents

func (c *Calendar) LoadEvents(userId string, start time.Time, end time.Time) ([]dto.Event, error)

func (*Calendar) SortEvents

func (c *Calendar) SortEvents(events []dto.Event)

type Scheduler

type Scheduler struct {
	// contains filtered or unexported fields
}

func NewSchedulerService

func NewSchedulerService(logger *util.Logger, plugin plugin.API, workspace *Workspace, user *User) *Scheduler

func (*Scheduler) AddCronJobs

func (s *Scheduler) AddCronJobs(userId string)

func (*Scheduler) DeleteCronJobs

func (s *Scheduler) DeleteCronJobs(userId string)

func (*Scheduler) InitCronJobs

func (s *Scheduler) InitCronJobs()

func (*Scheduler) StopCronJobs

func (s *Scheduler) StopCronJobs()

type Sender

type Sender struct {
	// contains filtered or unexported fields
}

func NewSenderService

func NewSenderService(
	manifestId string,
	botId string,
	logger *util.Logger,
	plugin plugin.API,
	supportedUserCustomStatus bool,
	serverConfig *model.Config) *Sender

func (*Sender) OpenSettingsDialog

func (s *Sender) OpenSettingsDialog(triggerId string, rootId string, calendars []caldav.Calendar, settings *dto.Settings) error

func (*Sender) SendBotDMPost

func (s *Sender) SendBotDMPost(userId string, message string)

func (*Sender) SendEvent

func (s *Sender) SendEvent(userId string, title string, event dto.Event)

func (*Sender) SendEvents

func (s *Sender) SendEvents(userId string, title string, events []dto.Event)

func (*Sender) SendWelcomePost

func (s *Sender) SendWelcomePost(userId string)

type User

type User struct {
	// contains filtered or unexported fields
}

func NewUserService

func NewUserService(
	logger *util.Logger,
	plugin plugin.API,
	supportedUserCustomStatus bool,
	credentialsRepo *repository.CredentialsRepo,
	sender *Sender,
	calendar *Calendar) *User

func (*User) Connect

func (u *User) Connect(userId string, triggerId string, rootId string, credentials dto.Credentials)

func (*User) IsUserExist

func (u *User) IsUserExist(userId string) bool

func (*User) LoadEventUpdates

func (u *User) LoadEventUpdates(userId string)

func (*User) Settings

func (u *User) Settings(userId string, triggerId string, rootId string)

func (*User) UserEventsHandler

func (u *User) UserEventsHandler(userId string)

type Workspace

type Workspace struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewWorkspaceService

func NewWorkspaceService(workspaceRepo *repository.WorkspaceRepo) *Workspace

func (*Workspace) AddUser

func (w *Workspace) AddUser(userId string)

func (*Workspace) DeleteUser

func (w *Workspace) DeleteUser(userId string)

func (*Workspace) GetUserIds

func (w *Workspace) GetUserIds() map[string]bool

Jump to

Keyboard shortcuts

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