forked from anujdecoder/ics
-
Notifications
You must be signed in to change notification settings - Fork 0
/
objects.go
94 lines (75 loc) · 1.76 KB
/
objects.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
package ics
import (
"time"
)
type Event struct {
Class CLASS
Summary string
Description string
Status EventStatus
Geo *GeoLocation
Location string
DtEnd time.Time
DtStart time.Time
RRule []string
ExRule []string
ExDate []time.Time
Transparency Transparency
Attendees []Attendee
Organizer Attendee
UID string
dtStamp string
}
type EventStatus string
const (
EventStatus_CONFIRMED EventStatus = "CONFIRMED"
EventStatus_CANCELLED EventStatus = "CANCELLED"
EventStatus_TENTATIVE EventStatus = "TENTATIVE"
)
type CLASS string
const (
Classification_PUBLIC CLASS = "PUBLIC"
Classification_PRIVATE CLASS = "PRIVATE"
Classification_CONFIDENTIAL CLASS = "CONFIDENTIAL"
)
type GeoLocation struct {
Latitude float32
Longitude float32
}
type Transparency string
const (
TRANSAPARENT Transparency = "TRANSPARENT"
OPAQUE Transparency = "OPAQUE"
)
type Attendee struct {
CommonName string
EmailAddress string
Role Role
PartStatus AttendeeStatus
//RSVP is by default NO
CuType CalendarUserType
Rsvp RSVP
}
type Role string
const (
REQUIRED Role = "REQ-PARTICIPANT"
)
type AttendeeStatus string
const (
AttendeeStatus_NeedAction AttendeeStatus = "NEEDS-ACTION"
AttendeeStatus_TENTATIVE AttendeeStatus = "TENTATIVE"
AttendeeStatus_ACCEPTED AttendeeStatus = "ACCEPTED"
AttendeeStatus_DECLINED AttendeeStatus = "DECLINED"
)
type CalendarUserType string
const (
INDIVIDUAL CalendarUserType = "INDIVIDUAL"
)
// This is related to PartStat
// https://datatracker.ietf.org/doc/html/rfc5545#section-3.2.12
// https://datatracker.ietf.org/doc/html/rfc5545#section-3.2.17
type RSVP string
const (
Rsvp_False RSVP = "FALSE"
Rsvp_True RSVP = "TRUE"
)