Skip to content

Commit

Permalink
migrate to new engine package
Browse files Browse the repository at this point in the history
  • Loading branch information
fmartingr committed Oct 4, 2023
1 parent 644ba46 commit 2eeafe7
Show file tree
Hide file tree
Showing 20 changed files with 32 additions and 30 deletions.
4 changes: 2 additions & 2 deletions gcal/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (

msgraph "github.com/yaegashi/msgraph.go/v1.0"

"github.com/mattermost/mattermost-plugin-mscalendar/server/config"
"github.com/mattermost/mattermost-plugin-mscalendar/server/utils/bot"
"github.com/mattermost/mattermost-plugin-mscalendar/calendar/config"
"github.com/mattermost/mattermost-plugin-mscalendar/calendar/utils/bot"
)

type client struct {
Expand Down
4 changes: 2 additions & 2 deletions gcal/create_calendar.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (

"github.com/pkg/errors"

"github.com/mattermost/mattermost-plugin-mscalendar/server/remote"
"github.com/mattermost/mattermost-plugin-mscalendar/server/utils/bot"
"github.com/mattermost/mattermost-plugin-mscalendar/calendar/remote"
"github.com/mattermost/mattermost-plugin-mscalendar/calendar/utils/bot"
)

// CreateCalendar creates a calendar
Expand Down
2 changes: 1 addition & 1 deletion gcal/delete_calendar.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package gcal
import (
"github.com/pkg/errors"

"github.com/mattermost/mattermost-plugin-mscalendar/server/utils/bot"
"github.com/mattermost/mattermost-plugin-mscalendar/calendar/utils/bot"
)

func (c *client) DeleteCalendar(remoteUserID string, calID string) error {
Expand Down
2 changes: 1 addition & 1 deletion gcal/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"google.golang.org/api/calendar/v3"
"google.golang.org/api/option"

"github.com/mattermost/mattermost-plugin-mscalendar/server/remote"
"github.com/mattermost/mattermost-plugin-mscalendar/calendar/remote"
)

func (c *client) GetEvent(remoteUserID, eventID string) (*remote.Event, error) {
Expand Down
2 changes: 1 addition & 1 deletion gcal/find_meeting_times.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

"github.com/pkg/errors"

"github.com/mattermost/mattermost-plugin-mscalendar/server/remote"
"github.com/mattermost/mattermost-plugin-mscalendar/calendar/remote"
)

// FindMeetingTimes finds meeting time suggestions for a calendar event
Expand Down
2 changes: 1 addition & 1 deletion gcal/gcal.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package gcal

import (
"github.com/mattermost/mattermost-plugin-mscalendar/server/config"
"github.com/mattermost/mattermost-plugin-mscalendar/calendar/config"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions gcal/get_calendars.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
"google.golang.org/api/calendar/v3"
"google.golang.org/api/option"

"github.com/mattermost/mattermost-plugin-mscalendar/server/remote"
"github.com/mattermost/mattermost-plugin-mscalendar/server/utils/bot"
"github.com/mattermost/mattermost-plugin-mscalendar/calendar/remote"
"github.com/mattermost/mattermost-plugin-mscalendar/calendar/utils/bot"
)

func (c *client) GetCalendars(remoteUserID string) ([]*remote.Calendar, error) {
Expand Down
4 changes: 2 additions & 2 deletions gcal/get_default_calendar_view.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
"google.golang.org/api/calendar/v3"
"google.golang.org/api/option"

"github.com/mattermost/mattermost-plugin-mscalendar/server/remote"
"github.com/mattermost/mattermost-plugin-mscalendar/server/utils"
"github.com/mattermost/mattermost-plugin-mscalendar/calendar/remote"
"github.com/mattermost/mattermost-plugin-mscalendar/calendar/utils"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion gcal/get_default_calendar_view_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/stretchr/testify/require"
"google.golang.org/api/calendar/v3"

"github.com/mattermost/mattermost-plugin-mscalendar/server/remote"
"github.com/mattermost/mattermost-plugin-mscalendar/calendar/remote"
)

func createMinimalCalendarEvent() calendar.Event {
Expand Down
2 changes: 1 addition & 1 deletion gcal/get_mailbox_settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"google.golang.org/api/calendar/v3"
"google.golang.org/api/option"

"github.com/mattermost/mattermost-plugin-mscalendar/server/remote"
"github.com/mattermost/mattermost-plugin-mscalendar/calendar/remote"
)

func (c *client) GetMailboxSettings(remoteUserID string) (*remote.MailboxSettings, error) {
Expand Down
2 changes: 1 addition & 1 deletion gcal/get_me.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"google.golang.org/api/option"
"google.golang.org/api/people/v1"

"github.com/mattermost/mattermost-plugin-mscalendar/server/remote"
"github.com/mattermost/mattermost-plugin-mscalendar/calendar/remote"
)

const personFields = "names,emailAddresses"
Expand Down
2 changes: 1 addition & 1 deletion gcal/get_notification_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"google.golang.org/api/calendar/v3"
"google.golang.org/api/option"

"github.com/mattermost/mattermost-plugin-mscalendar/server/remote"
"github.com/mattermost/mattermost-plugin-mscalendar/calendar/remote"
)

func (c *client) GetNotificationData(orig *remote.Notification) (*remote.Notification, error) {
Expand Down
2 changes: 1 addition & 1 deletion gcal/get_schedule.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package gcal

import (
"github.com/mattermost/mattermost-plugin-mscalendar/server/remote"
"github.com/mattermost/mattermost-plugin-mscalendar/calendar/remote"
)

func (c *client) GetSchedule(_ []*remote.ScheduleUserInfo, _, _ *remote.DateTime, _ int) ([]*remote.ScheduleInformation, error) {
Expand Down
2 changes: 1 addition & 1 deletion gcal/get_super_user_token.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
package gcal

import (
"github.com/mattermost/mattermost-plugin-mscalendar/server/remote"
"github.com/mattermost/mattermost-plugin-mscalendar/calendar/remote"
)

func (c *client) GetSuperuserToken() (string, error) {
Expand Down
2 changes: 1 addition & 1 deletion gcal/handle_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package gcal
import (
"net/http"

"github.com/mattermost/mattermost-plugin-mscalendar/server/remote"
"github.com/mattermost/mattermost-plugin-mscalendar/calendar/remote"
)

type webhook struct {
Expand Down
6 changes: 3 additions & 3 deletions gcal/remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import (
// msgraph "github.com/yaegashi/msgraph.go/v1.0"
"golang.org/x/oauth2/google"

"github.com/mattermost/mattermost-plugin-mscalendar/server/config"
"github.com/mattermost/mattermost-plugin-mscalendar/server/remote"
"github.com/mattermost/mattermost-plugin-mscalendar/server/utils/bot"
"github.com/mattermost/mattermost-plugin-mscalendar/calendar/config"
"github.com/mattermost/mattermost-plugin-mscalendar/calendar/remote"
"github.com/mattermost/mattermost-plugin-mscalendar/calendar/utils/bot"
)

const Kind = "gcal"
Expand Down
4 changes: 2 additions & 2 deletions gcal/subscription.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import (
"google.golang.org/api/calendar/v3"
"google.golang.org/api/option"

"github.com/mattermost/mattermost-plugin-mscalendar/server/remote"
"github.com/mattermost/mattermost-plugin-mscalendar/server/utils/bot"
"github.com/mattermost/mattermost-plugin-mscalendar/calendar/remote"
"github.com/mattermost/mattermost-plugin-mscalendar/calendar/utils/bot"
)

const subscribeTTL = 7 * 24 * time.Hour // 7 days
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/mattermost/mattermost-plugin-google-calendar
go 1.21

require (
github.com/mattermost/mattermost-plugin-mscalendar v1.2.2-0.20230906162454-c1bd4d35e637
github.com/mattermost/mattermost-plugin-mscalendar v1.2.2-0.20231003103350-78db3c300acd
github.com/mattermost/mattermost-server/v6 v6.3.0
github.com/mholt/archiver/v3 v3.5.1
github.com/pkg/errors v0.9.1
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -921,6 +921,8 @@ github.com/mattermost/mattermost-plugin-api v0.0.27 h1:zFKQ6JW1/f0MfR5dP9P2umNNY
github.com/mattermost/mattermost-plugin-api v0.0.27/go.mod h1:MM+tZ+36Obm9jqcveoxY2RFbwLaZKZUgR1zUlc0UBYw=
github.com/mattermost/mattermost-plugin-mscalendar v1.2.2-0.20230906162454-c1bd4d35e637 h1:u9adWfXFrwFRdE5JldzemEEW2ptArh37Kyzbc19tMJc=
github.com/mattermost/mattermost-plugin-mscalendar v1.2.2-0.20230906162454-c1bd4d35e637/go.mod h1:UMwu2MfV7UaowrX5OJ65OwBVPyi74iwAgcoJCHO1fzg=
github.com/mattermost/mattermost-plugin-mscalendar v1.2.2-0.20231003103350-78db3c300acd h1:wmO5eHFe7Dmr6xm/ISDzbX62cLkWFgUOrJ2SX1KKOas=
github.com/mattermost/mattermost-plugin-mscalendar v1.2.2-0.20231003103350-78db3c300acd/go.mod h1:ztdxRulZAgws2wzV5Pag7RuIDEHkEFtBcLK05V3o1f0=
github.com/mattermost/mattermost-server/v6 v6.3.0 h1:wxUBvu6whm2FAMm5n2J4xbchtrSndRW3g3VQnGt8KPw=
github.com/mattermost/mattermost-server/v6 v6.3.0/go.mod h1:L9gIoi9ESBh/NefsaZCfOVBMnbhx+v3kXhInGt3DQmA=
github.com/mattermost/rsc v0.0.0-20160330161541-bbaefb05eaa0/go.mod h1:nV5bfVpT//+B1RPD2JvRnxbkLmJEYXmRaaVl15fsXjs=
Expand Down
10 changes: 5 additions & 5 deletions server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
mattermostplugin "github.com/mattermost/mattermost-server/v6/plugin"

"github.com/mattermost/mattermost-plugin-google-calendar/gcal"
"github.com/mattermost/mattermost-plugin-mscalendar/server/config"
"github.com/mattermost/mattermost-plugin-mscalendar/server/mscalendar"
"github.com/mattermost/mattermost-plugin-mscalendar/server/plugin"
"github.com/mattermost/mattermost-plugin-mscalendar/calendar/config"
"github.com/mattermost/mattermost-plugin-mscalendar/calendar/engine"
"github.com/mattermost/mattermost-plugin-mscalendar/calendar/plugin"
)

var BuildHash string
Expand All @@ -19,7 +19,7 @@ func main() {

mattermostplugin.ClientMain(
plugin.NewWithEnv(
mscalendar.Env{
engine.Env{
Config: &config.Config{
PluginID: manifest.ID,
PluginVersion: manifest.Version,
Expand All @@ -28,6 +28,6 @@ func main() {
BuildDate: BuildDate,
Provider: config.Provider,
},
Dependencies: &mscalendar.Dependencies{},
Dependencies: &engine.Dependencies{},
}))
}

0 comments on commit 2eeafe7

Please sign in to comment.