Skip to content

Commit

Permalink
ResponseWS is renamed to WebToolsEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
petyos committed Jan 16, 2024
1 parent 8e56d4a commit 01579dd
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
8 changes: 4 additions & 4 deletions core/logic_events.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ func (e eventsLogic) start() {

}

func (e eventsLogic) getAllEvents() ([]model.ResponseWS, error) {
var allevents []model.ResponseWS
var events []model.ResponseWS
func (e eventsLogic) getAllEvents() ([]model.WebToolsEvent, error) {
var allevents []model.WebToolsEvent
var events []model.WebToolsEvent
var legacyEvent []model.LegacyEvent
page := 0
for {
Expand All @@ -59,7 +59,7 @@ func (e eventsLogic) getAllEvents() ([]model.ResponseWS, error) {
break
}

var parsed model.ResponseWS
var parsed model.WebToolsEvent
err = xml.Unmarshal(data, &parsed)
if err != nil {
log.Printf("error: %s", err)
Expand Down
11 changes: 6 additions & 5 deletions core/model/legacyEvents.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,20 @@ const (
TypeLegacyEvents logutils.MessageDataType = "legacy_events"
)

type ResponseWS struct {
// WebToolsEvent represents web tools event
type WebToolsEvent struct {
XMLName xml.Name `xml:"responseWS"`
Text string `xml:",chardata"`
Deprecated string `xml:"deprecated"`
MaxPageSize string `xml:"maxPageSize"`
PublicEventWS []struct {
Text string `xml:",chardata"`
CalendarId string `xml:"calendarId"`
CalendarID string `xml:"calendarId"`
CalendarName string `xml:"calendarName"`
EventId string `xml:"eventId"`
EventID string `xml:"eventId"`
Recurrence string `xml:"recurrence"`
RecurrenceId string `xml:"recurrenceId"`
OriginatingCalendarId string `xml:"originatingCalendarId"`
RecurrenceID string `xml:"recurrenceId"`
OriginatingCalendarID string `xml:"originatingCalendarId"`
OriginatingCalendarName string `xml:"originatingCalendarName"`
Title string `xml:"title"`
TitleURL string `xml:"titleURL"`
Expand Down
2 changes: 1 addition & 1 deletion driven/storage/adapter_example.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func (a *Adapter) DeleteExample(orgID string, appID string, id string) error {
return nil
}

// InsertExample inserts a new example
// SaveLegacyEvents inserts a new example
func (a *Adapter) SaveLegacyEvents(legacyEvents []model.LegacyEvent) error {

records := []interface{}{}
Expand Down

0 comments on commit 01579dd

Please sign in to comment.