gg_vcal

package
v0.2.30 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: BSD-3-Clause Imports: 14 Imported by: 1

README

VCalendar (ics and ical) Parser

This library is a custom implementation starting from great ARRAN4 golang-ical project.

I needed a different implementation, so this is why I forked the original repository.

Documentation

Index

Constants

View Source
const (
	ComponentPropertyUniqueId            = ComponentProperty(PropertyUid) // TEXT
	ComponentPropertyDtstamp             = ComponentProperty(PropertyDtstamp)
	ComponentPropertyOrganizer           = ComponentProperty(PropertyOrganizer)
	ComponentPropertyAttendee            = ComponentProperty(PropertyAttendee)
	ComponentPropertyAttach              = ComponentProperty(PropertyAttach)
	ComponentPropertyDescription         = ComponentProperty(PropertyDescription) // TEXT
	ComponentPropertyCategories          = ComponentProperty(PropertyCategories)  // TEXT
	ComponentPropertyClass               = ComponentProperty(PropertyClass)       // TEXT
	ComponentPropertyColor               = ComponentProperty(PropertyColor)       // TEXT
	ComponentPropertyCreated             = ComponentProperty(PropertyCreated)
	ComponentPropertySummary             = ComponentProperty(PropertySummary) // TEXT
	ComponentPropertyDtStart             = ComponentProperty(PropertyDtstart)
	ComponentPropertyDtEnd               = ComponentProperty(PropertyDtend)
	ComponentPropertyLocation            = ComponentProperty(PropertyLocation)            // TEXT
	ComponentPropertyXMicrosoftLocations = ComponentProperty(PropertyXMicrosoftLocations) // array of map
	ComponentPropertyStatus              = ComponentProperty(PropertyStatus)              // TEXT
	ComponentPropertyFreebusy            = ComponentProperty(PropertyFreebusy)
	ComponentPropertyLastModified        = ComponentProperty(PropertyLastModified)
	ComponentPropertyUrl                 = ComponentProperty(PropertyUrl)
	ComponentPropertyGeo                 = ComponentProperty(PropertyGeo)
	ComponentPropertyTransp              = ComponentProperty(PropertyTransp)
	ComponentPropertySequence            = ComponentProperty(PropertySequence)
	ComponentPropertyExdate              = ComponentProperty(PropertyExdate)
	ComponentPropertyExrule              = ComponentProperty(PropertyExrule)
	ComponentPropertyRdate               = ComponentProperty(PropertyRdate)
	ComponentPropertyRrule               = ComponentProperty(PropertyRrule)
	ComponentPropertyAction              = ComponentProperty(PropertyAction)
	ComponentPropertyTrigger             = ComponentProperty(PropertyTrigger)
)

Variables

View Source
var (
	CalendarStateError     = errors.New("calendar_state_error")
	MalformedCalendarError = errors.New("malformed_calendar_error")

	ConferencePlatforms = []string{"skype", "zoom", "meet", "gotomeeting", "pexip",
		"facebook", "messenger", "telegram", "whatsapp"}
)

Functions

func FromText

func FromText(s string) string

func GetPropertyAsString

func GetPropertyAsString(componentProperty ComponentProperty, properties []IANAProperty) (string, error)

func GetPropertyAsTime

func GetPropertyAsTime(componentProperty ComponentProperty, tFormat string, properties []IANAProperty) (t time.Time, err error)

func Serialize

func Serialize(component GeneralComponent) string

func SerializeThis

func SerializeThis(component ComponentBase, writer io.Writer, componentType string)

func ToText

func ToText(s string) string

func ToTime

func ToTime(format, value string) (t time.Time, err error)

Types

type Action

type Action string
const (
	ActionAudio     Action = "AUDIO"
	ActionDisplay   Action = "DISPLAY"
	ActionEmail     Action = "EMAIL"
	ActionProcedure Action = "PROCEDURE"
)

type Attendee

type Attendee struct {
	IANAProperty
}

func (*Attendee) Email

func (instance *Attendee) Email() string

func (*Attendee) ParticipationStatus

func (instance *Attendee) ParticipationStatus() ParticipationStatus

type BaseProperty

type BaseProperty struct {
	IANAToken      string
	ICalParameters map[string][]string
	Value          string
}

func ParseProperty

func ParseProperty(contentLine ContentLine) *BaseProperty

type Calendar

type Calendar struct {
	Components         []Component
	CalendarProperties []CalendarProperty
}

func NewCalendarFor

func NewCalendarFor(service string) *Calendar

func ParseCalendar

func ParseCalendar(r io.Reader) (*Calendar, error)

func (*Calendar) AddEvent

func (instance *Calendar) AddEvent(id string) *VEvent

func (*Calendar) AddVEvent

func (instance *Calendar) AddVEvent(e *VEvent)

func (*Calendar) CalScale

func (instance *Calendar) CalScale() string

func (*Calendar) EventGetEndAt

func (instance *Calendar) EventGetEndAt() (t time.Time, err error)

func (*Calendar) EventGetLocation

func (instance *Calendar) EventGetLocation() string

func (*Calendar) EventGetStartAt

func (instance *Calendar) EventGetStartAt() (t time.Time, err error)

func (*Calendar) Events

func (instance *Calendar) Events() (events []*VEvent)

func (*Calendar) IsTimeZoneGreenwichStandard

func (instance *Calendar) IsTimeZoneGreenwichStandard() bool

func (*Calendar) Method

func (instance *Calendar) Method() string

func (*Calendar) Name

func (instance *Calendar) Name() string

func (*Calendar) Priority

func (instance *Calendar) Priority() string

func (*Calendar) ProdId

func (instance *Calendar) ProdId() string

func (*Calendar) ProdVendor

func (instance *Calendar) ProdVendor() string

func (*Calendar) SerializeTo

func (instance *Calendar) SerializeTo(w io.Writer) error

func (*Calendar) SetCalscale

func (instance *Calendar) SetCalscale(s string, props ...PropertyParameter)

func (*Calendar) SetColor

func (instance *Calendar) SetColor(s string, props ...PropertyParameter)

func (*Calendar) SetDescription

func (instance *Calendar) SetDescription(s string, props ...PropertyParameter)

func (*Calendar) SetLastModified

func (instance *Calendar) SetLastModified(t time.Time, props ...PropertyParameter)

func (*Calendar) SetMethod

func (instance *Calendar) SetMethod(method Method, props ...PropertyParameter)

func (*Calendar) SetName

func (instance *Calendar) SetName(s string, props ...PropertyParameter)

func (*Calendar) SetProductId

func (instance *Calendar) SetProductId(s string, props ...PropertyParameter)

func (*Calendar) SetRefreshInterval

func (instance *Calendar) SetRefreshInterval(s string, props ...PropertyParameter)

func (*Calendar) SetTzid

func (instance *Calendar) SetTzid(s string, props ...PropertyParameter)

func (*Calendar) SetVersion

func (instance *Calendar) SetVersion(s string, props ...PropertyParameter)

func (*Calendar) SetXPublishedTTL

func (instance *Calendar) SetXPublishedTTL(s string, props ...PropertyParameter)

func (*Calendar) SetXWRCalDesc

func (instance *Calendar) SetXWRCalDesc(s string, props ...PropertyParameter)

func (*Calendar) SetXWRCalID

func (instance *Calendar) SetXWRCalID(s string, props ...PropertyParameter)

func (*Calendar) SetXWRCalName

func (instance *Calendar) SetXWRCalName(s string, props ...PropertyParameter)

func (*Calendar) SetXWRTimezone

func (instance *Calendar) SetXWRTimezone(s string, props ...PropertyParameter)

func (*Calendar) String

func (instance *Calendar) String() string

func (*Calendar) TimeZone

func (instance *Calendar) TimeZone() *VTimezone

func (*Calendar) Version

func (instance *Calendar) Version() string

type CalendarProperty

type CalendarProperty struct {
	BaseProperty
}

type CalendarStream

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

func NewCalendarStream

func NewCalendarStream(r io.Reader) *CalendarStream

func (*CalendarStream) ReadLine

func (instance *CalendarStream) ReadLine() (*ContentLine, error)

type CalendarUserType

type CalendarUserType string
const (
	CalendarUserTypeIndividual CalendarUserType = "INDIVIDUAL"
	CalendarUserTypeGroup      CalendarUserType = "GROUP"
	CalendarUserTypeResource   CalendarUserType = "RESOURCE"
	CalendarUserTypeRoom       CalendarUserType = "ROOM"
	CalendarUserTypeUnknown    CalendarUserType = "UNKNOWN"
)

func (CalendarUserType) KeyValue

func (cut CalendarUserType) KeyValue(s ...interface{}) (string, []string)

type Classification

type Classification string
const (
	ClassificationPublic       Classification = "PUBLIC"
	ClassificationPrivate      Classification = "PRIVATE"
	ClassificationConfidential Classification = "CONFIDENTIAL"
)

type Component

type Component interface {
	UnknownPropertiesIANAProperties() []IANAProperty
	SubComponents() []Component
	// contains filtered or unexported methods
}

func GeneralParseComponent

func GeneralParseComponent(cs *CalendarStream, startLine *BaseProperty) (Component, error)

type ComponentBase

type ComponentBase struct {
	Properties []IANAProperty
	Components []Component
}

func ParseComponent

func ParseComponent(cs *CalendarStream, startLine *BaseProperty) (ComponentBase, error)

func (*ComponentBase) SubComponents

func (instance *ComponentBase) SubComponents() []Component

func (*ComponentBase) UnknownPropertiesIANAProperties

func (instance *ComponentBase) UnknownPropertiesIANAProperties() []IANAProperty

type ComponentProperty

type ComponentProperty Property

type ComponentType

type ComponentType string
const (
	ComponentVCalendar ComponentType = "VCALENDAR"
	ComponentVEvent    ComponentType = "VEVENT"
	ComponentVTodo     ComponentType = "VTODO"
	ComponentVJournal  ComponentType = "VJOURNAL"
	ComponentVFreeBusy ComponentType = "VFREEBUSY"
	ComponentVTimezone ComponentType = "VTIMEZONE"
	ComponentVAlarm    ComponentType = "VALARM"
	ComponentStandard  ComponentType = "STANDARD"
	ComponentDaylight  ComponentType = "DAYLIGHT"
)

type ContentLine

type ContentLine string

type Daylight

type Daylight struct {
	ComponentBase
}

func ParseDaylight

func ParseDaylight(cs *CalendarStream, startLine *BaseProperty) *Daylight

func (*Daylight) Serialize

func (instance *Daylight) Serialize() string

type FreeBusyTimeType

type FreeBusyTimeType string
const (
	FreeBusyTimeTypeFree            FreeBusyTimeType = "FREE"
	FreeBusyTimeTypeBusy            FreeBusyTimeType = "BUSY"
	FreeBusyTimeTypeBusyUnavailable FreeBusyTimeType = "BUSY-UNAVAILABLE"
	FreeBusyTimeTypeBusyTentative   FreeBusyTimeType = "BUSY-TENTATIVE"
)

type GeneralComponent

type GeneralComponent struct {
	ComponentBase
	Token string
}

func ParseGeneralComponent

func ParseGeneralComponent(cs *CalendarStream, startLine *BaseProperty) *GeneralComponent

func (*GeneralComponent) Serialize

func (instance *GeneralComponent) Serialize() string

type IANAProperty

type IANAProperty struct {
	BaseProperty
}

func GetProperty

func GetProperty(componentProperty ComponentProperty, properties []IANAProperty) *IANAProperty

type KeyValues

type KeyValues struct {
	Key   string
	Value []string
}

func (*KeyValues) KeyValue

func (kv *KeyValues) KeyValue(s ...interface{}) (string, []string)

type Method

type Method string
const (
	MethodPublish        Method = "PUBLISH"
	MethodRequest        Method = "REQUEST"
	MethodReply          Method = "REPLY"
	MethodAdd            Method = "ADD"
	MethodCancel         Method = "CANCEL"
	MethodRefresh        Method = "REFRESH"
	MethodCounter        Method = "COUNTER"
	MethodDeclinecounter Method = "DECLINECOUNTER"
)

type ObjectStatus

type ObjectStatus string
const (
	ObjectStatusTentative   ObjectStatus = "TENTATIVE"
	ObjectStatusConfirmed   ObjectStatus = "CONFIRMED"
	ObjectStatusCancelled   ObjectStatus = "CANCELLED"
	ObjectStatusNeedsAction ObjectStatus = "NEEDS-ACTION"
	ObjectStatusCompleted   ObjectStatus = "COMPLETED"
	ObjectStatusInProcess   ObjectStatus = "IN-PROCESS"
	ObjectStatusDraft       ObjectStatus = "DRAFT"
	ObjectStatusFinal       ObjectStatus = "FINAL"
)

func (ObjectStatus) KeyValue

func (ps ObjectStatus) KeyValue(s ...interface{}) (string, []string)

type Parameter

type Parameter string
const (
	ParameterAltrep              Parameter = "ALTREP"
	ParameterCn                  Parameter = "CN"
	ParameterCutype              Parameter = "CUTYPE"
	ParameterDelegatedFrom       Parameter = "DELEGATED-FROM"
	ParameterDelegatedTo         Parameter = "DELEGATED-TO"
	ParameterDir                 Parameter = "DIR"
	ParameterEncoding            Parameter = "ENCODING"
	ParameterFmttype             Parameter = "FMTTYPE"
	ParameterFbtype              Parameter = "FBTYPE"
	ParameterLanguage            Parameter = "LANGUAGE"
	ParameterMember              Parameter = "MEMBER"
	ParameterParticipationStatus Parameter = "PARTSTAT"
	ParameterRange               Parameter = "RANGE"
	ParameterRelated             Parameter = "RELATED"
	ParameterReltype             Parameter = "RELTYPE"
	ParameterRole                Parameter = "ROLE"
	ParameterRsvp                Parameter = "RSVP"
	ParameterSentBy              Parameter = "SENT-BY"
	ParameterTzid                Parameter = "TZID"
	ParameterValue               Parameter = "VALUE"
)

type ParticipationRole

type ParticipationRole string
const (
	ParticipationRoleChair          ParticipationRole = "CHAIR"
	ParticipationRoleReqParticipant ParticipationRole = "REQ-PARTICIPANT"
	ParticipationRoleOptParticipant ParticipationRole = "OPT-PARTICIPANT"
	ParticipationRoleNonParticipant ParticipationRole = "NON-PARTICIPANT"
)

func (ParticipationRole) KeyValue

func (pr ParticipationRole) KeyValue(s ...interface{}) (string, []string)

type ParticipationStatus

type ParticipationStatus string
const (
	ParticipationStatusNeedsAction ParticipationStatus = "NEEDS-ACTION"
	ParticipationStatusAccepted    ParticipationStatus = "ACCEPTED"
	ParticipationStatusDeclined    ParticipationStatus = "DECLINED"
	ParticipationStatusTentative   ParticipationStatus = "TENTATIVE"
	ParticipationStatusDelegated   ParticipationStatus = "DELEGATED"
	ParticipationStatusCompleted   ParticipationStatus = "COMPLETED"
	ParticipationStatusInProcess   ParticipationStatus = "IN-PROCESS"
)

func (ParticipationStatus) KeyValue

func (ps ParticipationStatus) KeyValue(s ...interface{}) (string, []string)

type PropByDay

type PropByDay string
const (
	PropByDaySunday    PropByDay = "SU"
	PropByDayMonday    PropByDay = "MO"
	PropByDayTuesday   PropByDay = "TU"
	PropByDayWednesday PropByDay = "WE"
	PropByDayThursday  PropByDay = "TH"
	PropByDayFriday    PropByDay = "FR"
	PropByDaySaturday  PropByDay = "SA"
	PropByDayFormula   PropByDay = ""
)

func ParsePropByDay

func ParsePropByDay(value string) PropByDay

func (PropByDay) String

func (instance PropByDay) String() string

func (PropByDay) Weekday

func (instance PropByDay) Weekday() time.Weekday

type PropByDayValue

type PropByDayValue struct {
	ByDay    []PropByDay
	Formula  string
	RawValue string
}

func (PropByDayValue) GoString

func (instance PropByDayValue) GoString() string

func (*PropByDayValue) MarshalJSON

func (instance *PropByDayValue) MarshalJSON() ([]byte, error)

func (PropByDayValue) String

func (instance PropByDayValue) String() string

type PropFrequency

type PropFrequency string
const (
	PropFreqSecondly PropFrequency = "SECONDLY"
	PropFreqMinutely PropFrequency = "MINUTELY"
	PropFreqHourly   PropFrequency = "HOURLY"
	PropFreqDaily    PropFrequency = "DAILY"
	PropFreqWeekly   PropFrequency = "WEEKLY"
	PropFreqMonthly  PropFrequency = "MONTHLY"
	PropFreqYearly   PropFrequency = "YEARLY"
)

func ParsePropFrequency

func ParsePropFrequency(value string) PropFrequency

func (PropFrequency) String

func (instance PropFrequency) String() string

type Property

type Property string
const (
	PropertyCalscale            Property = "CALSCALE" // TEXT
	PropertyMethod              Property = "METHOD"   // TEXT
	PropertyProductId           Property = "PRODID"   // TEXT
	PropertyVersion             Property = "VERSION"  // TEXT
	PropertyXPublishedTTL       Property = "X-PUBLISHED-TTL"
	PropertyRefreshInterval     Property = "REFRESH-INTERVAL;VALUE=DURATION"
	PropertyAttach              Property = "ATTACH"
	PropertyCategories          Property = "CATEGORIES"  // TEXT
	PropertyClass               Property = "CLASS"       // TEXT
	PropertyColor               Property = "COLOR"       // TEXT
	PropertyComment             Property = "COMMENT"     // TEXT
	PropertyDescription         Property = "DESCRIPTION" // TEXT
	PropertyXWRCalDesc          Property = "X-WR-CALDESC"
	PropertyGeo                 Property = "GEO"
	PropertyLocation            Property = "LOCATION" // TEXT
	PropertyXMicrosoftLocations Property = "X-MICROSOFT-LOCATIONS"
	PropertyPercentComplete     Property = "PERCENT-COMPLETE"
	PropertyPriority            Property = "PRIORITY"
	PropertyResources           Property = "RESOURCES" // TEXT
	PropertyStatus              Property = "STATUS"    // TEXT
	PropertySummary             Property = "SUMMARY"   // TEXT
	PropertyCompleted           Property = "COMPLETED"
	PropertyDtend               Property = "DTEND"
	PropertyDue                 Property = "DUE"
	PropertyDtstart             Property = "DTSTART"
	PropertyDuration            Property = "DURATION"
	PropertyFreebusy            Property = "FREEBUSY"
	PropertyTransp              Property = "TRANSP" // TEXT
	PropertyTzid                Property = "TZID"   // TEXT
	PropertyTzname              Property = "TZNAME" // TEXT
	PropertyTzoffsetfrom        Property = "TZOFFSETFROM"
	PropertyTzoffsetto          Property = "TZOFFSETTO"
	PropertyTzurl               Property = "TZURL"
	PropertyAttendee            Property = "ATTENDEE"
	PropertyContact             Property = "CONTACT" // TEXT
	PropertyOrganizer           Property = "ORGANIZER"
	PropertyRecurrenceId        Property = "RECURRENCE-ID"
	PropertyRelatedTo           Property = "RELATED-TO" // TEXT
	PropertyUrl                 Property = "URL"
	PropertyUid                 Property = "UID" // TEXT
	PropertyExdate              Property = "EXDATE"
	PropertyExrule              Property = "EXRULE"
	PropertyRdate               Property = "RDATE"
	PropertyRrule               Property = "RRULE"
	PropertyAction              Property = "ACTION" // TEXT
	PropertyRepeat              Property = "REPEAT"
	PropertyTrigger             Property = "TRIGGER"
	PropertyCreated             Property = "CREATED"
	PropertyDtstamp             Property = "DTSTAMP"
	PropertyLastModified        Property = "LAST-MODIFIED"
	PropertyRequestStatus       Property = "REQUEST-STATUS" // TEXT
	PropertyName                Property = "NAME"
	PropertyXWRCalName          Property = "X-WR-CALNAME"
	PropertyXWRTimezone         Property = "X-WR-TIMEZONE"
	PropertySequence            Property = "SEQUENCE"
	PropertyXWRCalID            Property = "X-WR-RELCALID"
)

type PropertyParameter

type PropertyParameter interface {
	KeyValue(s ...interface{}) (string, []string)
}

func WithCN

func WithCN(cn string) PropertyParameter

func WithEncoding

func WithEncoding(encType string) PropertyParameter

func WithFmtType

func WithFmtType(contentType string) PropertyParameter

func WithRSVP

func WithRSVP(b bool) PropertyParameter

func WithValue

func WithValue(kind string) PropertyParameter

type RRule

type RRule struct {
	EventId       string          `json:"event_id"`
	Frequency     PropFrequency   `json:"freq"`     // "SECONDLY" / "MINUTELY" / "HOURLY" / "DAILY" / "WEEKLY" / "MONTHLY" / "YEARLY"
	ByDay         *PropByDayValue `json:"byday"`    // "SU" / "MO" / "TU" / "WE" / "TH" / "FR" / "SA". Each BYDAY value can also be preceded by a positive (+n) or negative (-n) integer. If present, this indicates the nth occurrence of a specific day within the MONTHLY or YEARLY "RRULE". For example, within a MONTHLY rule, +1MO (or simply 1MO) represents the first Monday within the month, whereas -1MO represents the last Monday of the month.
	ByMonth       int             `json:"bymonth"`  // The BYMONTH rule part specifies a COMMA-separated list of months of the year. Valid values are 1 to 12.
	Until         time.Time       `json:"until"`    // The UNTIL rule part defines a DATE or DATE-TIME value that bounds the recurrence rule in an inclusive manner.
	Interval      int             `json:"interval"` // default is 1. The INTERVAL rule part contains a positive integer representing at which intervals the recurrence rule repeats. The default value is "1", meaning every second for a SECONDLY rule, every minute for a MINUTELY rule
	Count         int             `json:"count"`    // number or repeat. The COUNT rule part defines the number of occurrences at which to range-bound the recurrence. The "DTSTART" property value always counts as the first occurrence.
	WorkWeekStart PropByDay       `json:"wkst"`     // The WKST rule part specifies the day on which the workweek starts. Valid values are MO, TU, WE, TH, FR, SA, and SU. This is significant when a WEEKLY "RRULE" has an interval greater than 1, and a BYDAY rule part is specified.
}

RRule repeat rule https://icalendar.org/iCalendar-RFC-5545/3-3-10-recurrence-rule.html FREQ=WEEKLY;BYDAY=FR,MO,TH,TU,WE FREQ=WEEKLY;UNTIL=20220329T170000Z;INTERVAL=1;BYDAY=TU,WE,FR;WKST=SU FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU

func ParseRRule

func ParseRRule(text string) (*RRule, error)

func (*RRule) GetSlots

func (instance *RRule) GetSlots(eventStart, eventEnd, until time.Time) []*RRuleSlot

func (*RRule) Json

func (instance *RRule) Json() string

func (*RRule) Serialize

func (instance *RRule) Serialize() string

func (*RRule) String

func (instance *RRule) String() string

type RRuleSlot

type RRuleSlot struct {
	EventId  string        `json:"event_id"`
	StartAt  time.Time     `json:"start_at"`
	EndAt    time.Time     `json:"end_at"`
	Duration time.Duration `json:"duration"`
}

func NewRRuleSlot

func NewRRuleSlot(eventId string, start, end time.Time) *RRuleSlot

func (*RRuleSlot) String

func (instance *RRuleSlot) String() string

type RelationshipType

type RelationshipType string
const (
	RelationshipTypeChild   RelationshipType = "CHILD"
	RelationshipTypeParent  RelationshipType = "PARENT"
	RelationshipTypeSibling RelationshipType = "SIBLING"
)

type Standard

type Standard struct {
	ComponentBase
}

func ParseStandard

func ParseStandard(cs *CalendarStream, startLine *BaseProperty) *Standard

func (*Standard) Serialize

func (instance *Standard) Serialize() string

type TimeTransparency

type TimeTransparency string
const (
	TransparencyOpaque      TimeTransparency = "OPAQUE" // default
	TransparencyTransparent TimeTransparency = "TRANSPARENT"
)

type VAlarm

type VAlarm struct {
	ComponentBase
}

func ParseVAlarm

func ParseVAlarm(cs *CalendarStream, startLine *BaseProperty) *VAlarm

func (*VAlarm) AddProperty

func (instance *VAlarm) AddProperty(property ComponentProperty, value string, props ...PropertyParameter)

func (*VAlarm) Serialize

func (instance *VAlarm) Serialize() string

func (*VAlarm) SetAction

func (instance *VAlarm) SetAction(a Action, props ...PropertyParameter)

func (*VAlarm) SetProperty

func (instance *VAlarm) SetProperty(property ComponentProperty, value string, props ...PropertyParameter)

func (*VAlarm) SetTrigger

func (instance *VAlarm) SetTrigger(s string, props ...PropertyParameter)

type VBusy

type VBusy struct {
	ComponentBase
}

func ParseVBusy

func ParseVBusy(cs *CalendarStream, startLine *BaseProperty) *VBusy

func (*VBusy) Serialize

func (instance *VBusy) Serialize() string

type VCalHelper

type VCalHelper struct {
}
var VCal *VCalHelper

func (*VCalHelper) New

func (instance *VCalHelper) New() *Calendar

func (*VCalHelper) NewForService

func (instance *VCalHelper) NewForService(service string) *Calendar

func (*VCalHelper) Parse

func (instance *VCalHelper) Parse(data interface{}) (*Calendar, error)

type VEvent

type VEvent struct {
	ComponentBase
}

func NewEvent

func NewEvent(uniqueId string) *VEvent

func ParseVEvent

func ParseVEvent(cs *CalendarStream, startLine *BaseProperty) *VEvent

func (*VEvent) AddAlarm

func (instance *VEvent) AddAlarm() *VAlarm

func (*VEvent) AddAttachment

func (instance *VEvent) AddAttachment(s string, props ...PropertyParameter)

func (*VEvent) AddAttachmentBinary

func (instance *VEvent) AddAttachmentBinary(binary []byte, contentType string)

func (*VEvent) AddAttachmentURL

func (instance *VEvent) AddAttachmentURL(uri string, contentType string)

func (*VEvent) AddAttendee

func (instance *VEvent) AddAttendee(s string, props ...PropertyParameter)

func (*VEvent) AddExdate

func (instance *VEvent) AddExdate(s string, props ...PropertyParameter)

func (*VEvent) AddExrule

func (instance *VEvent) AddExrule(s string, props ...PropertyParameter)

func (*VEvent) AddProperty

func (instance *VEvent) AddProperty(property ComponentProperty, value string, props ...PropertyParameter)

func (*VEvent) AddRdate

func (instance *VEvent) AddRdate(s string, props ...PropertyParameter)

func (*VEvent) AddRrule

func (instance *VEvent) AddRrule(s string, props ...PropertyParameter)

func (*VEvent) Alarms

func (instance *VEvent) Alarms() (r []*VAlarm)

func (*VEvent) Attendees

func (instance *VEvent) Attendees() (r []*Attendee)

func (*VEvent) AttendeesEmails

func (instance *VEvent) AttendeesEmails() (response []string)

func (*VEvent) Description

func (instance *VEvent) Description() string

func (*VEvent) Duration

func (instance *VEvent) Duration() time.Duration

func (*VEvent) GetAllDayEndAt

func (instance *VEvent) GetAllDayEndAt() (t time.Time, err error)

func (*VEvent) GetAllDayStartAt

func (instance *VEvent) GetAllDayStartAt() (t time.Time, err error)

func (*VEvent) GetEndAt

func (instance *VEvent) GetEndAt() (t time.Time, err error)

func (*VEvent) GetProperty

func (instance *VEvent) GetProperty(componentProperty ComponentProperty) *IANAProperty

func (*VEvent) GetSlots

func (instance *VEvent) GetSlots(until time.Time) []*RRuleSlot

func (*VEvent) GetStartAt

func (instance *VEvent) GetStartAt() (t time.Time, err error)

func (*VEvent) Id

func (instance *VEvent) Id() string

func (*VEvent) IsStatusCancelled

func (instance *VEvent) IsStatusCancelled() bool

func (*VEvent) LinkMeeting

func (instance *VEvent) LinkMeeting() string
func (instance *VEvent) Links() []string

func (*VEvent) Location

func (instance *VEvent) Location() string

func (*VEvent) Organizer

func (instance *VEvent) Organizer() string

func (*VEvent) RRule

func (instance *VEvent) RRule() *RRule

RRule Repeat Rule

func (*VEvent) SetAllDayEndAt

func (instance *VEvent) SetAllDayEndAt(t time.Time, props ...PropertyParameter)

func (*VEvent) SetAllDayStartAt

func (instance *VEvent) SetAllDayStartAt(t time.Time, props ...PropertyParameter)

func (*VEvent) SetClass

func (instance *VEvent) SetClass(c Classification, props ...PropertyParameter)

func (*VEvent) SetColor

func (instance *VEvent) SetColor(s string, props ...PropertyParameter)

func (*VEvent) SetCreatedTime

func (instance *VEvent) SetCreatedTime(t time.Time, props ...PropertyParameter)

func (*VEvent) SetDescription

func (instance *VEvent) SetDescription(s string, props ...PropertyParameter)

func (*VEvent) SetDtStampTime

func (instance *VEvent) SetDtStampTime(t time.Time, props ...PropertyParameter)

func (*VEvent) SetEndAt

func (instance *VEvent) SetEndAt(t time.Time, props ...PropertyParameter)

func (*VEvent) SetGeo

func (instance *VEvent) SetGeo(lat interface{}, lng interface{}, props ...PropertyParameter)

func (*VEvent) SetLocation

func (instance *VEvent) SetLocation(s string, props ...PropertyParameter)

func (*VEvent) SetModifiedAt

func (instance *VEvent) SetModifiedAt(t time.Time, props ...PropertyParameter)

func (*VEvent) SetOrganizer

func (instance *VEvent) SetOrganizer(s string, props ...PropertyParameter)

func (*VEvent) SetProperty

func (instance *VEvent) SetProperty(property ComponentProperty, value string, props ...PropertyParameter)

func (*VEvent) SetSequence

func (instance *VEvent) SetSequence(seq int, props ...PropertyParameter)

func (*VEvent) SetStartAt

func (instance *VEvent) SetStartAt(t time.Time, props ...PropertyParameter)

func (*VEvent) SetStatus

func (instance *VEvent) SetStatus(s ObjectStatus, props ...PropertyParameter)

func (*VEvent) SetSummary

func (instance *VEvent) SetSummary(s string, props ...PropertyParameter)

func (*VEvent) SetTimeTransparency

func (instance *VEvent) SetTimeTransparency(v TimeTransparency, props ...PropertyParameter)

func (*VEvent) SetURL

func (instance *VEvent) SetURL(s string, props ...PropertyParameter)

func (*VEvent) Status

func (instance *VEvent) Status() string

func (*VEvent) String

func (instance *VEvent) String() string

func (*VEvent) Summary

func (instance *VEvent) Summary() string

type VJournal

type VJournal struct {
	ComponentBase
}

func ParseVJournal

func ParseVJournal(cs *CalendarStream, startLine *BaseProperty) *VJournal

func (*VJournal) Serialize

func (instance *VJournal) Serialize() string

type VTimezone

type VTimezone struct {
	ComponentBase
}

func ParseVTimezone

func ParseVTimezone(cs *CalendarStream, startLine *BaseProperty) *VTimezone

func (*VTimezone) Serialize

func (instance *VTimezone) Serialize() string

func (*VTimezone) Value

func (instance *VTimezone) Value() string

type VTodo

type VTodo struct {
	ComponentBase
}

func ParseVTodo

func ParseVTodo(cs *CalendarStream, startLine *BaseProperty) *VTodo

func (*VTodo) Serialize

func (instance *VTodo) Serialize() string

type ValueDataType

type ValueDataType string
const (
	ValueDataTypeBinary     ValueDataType = "BINARY"
	ValueDataTypeBoolean    ValueDataType = "BOOLEAN"
	ValueDataTypeCalAddress ValueDataType = "CAL-ADDRESS"
	ValueDataTypeDate       ValueDataType = "DATE"
	ValueDataTypeDateTime   ValueDataType = "DATE-TIME"
	ValueDataTypeDuration   ValueDataType = "DURATION"
	ValueDataTypeFloat      ValueDataType = "FLOAT"
	ValueDataTypeInteger    ValueDataType = "INTEGER"
	ValueDataTypePeriod     ValueDataType = "PERIOD"
	ValueDataTypeRecur      ValueDataType = "RECUR"
	ValueDataTypeText       ValueDataType = "TEXT"
	ValueDataTypeTime       ValueDataType = "TIME"
	ValueDataTypeUri        ValueDataType = "URI"
	ValueDataTypeUtcOffset  ValueDataType = "UTC-OFFSET"
)

Jump to

Keyboard shortcuts

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