MJKWoolnough / ics

Package ics implements an encoder and decoder for iCalendar files
ISC License
5 stars 2 forks source link

ics

-- import "vimagination.zapto.org/ics"

Package ics implements an encoder and decoder for iCalendar files

Usage

var (
    ErrInvalidParam = errors.New("invalid param value")
    ErrInvalidValue = errors.New("invalid value")
)

Errors.

var (
    ErrInvalidEnd        = errors.New("invalid end of section")
    ErrMissingRequired   = errors.New("required property missing")
    ErrRequirementNotMet = errors.New("requirement not met")
)

Errors.

var (
    ErrInvalidStructure   = errors.New("invalid structure")
    ErrMissingAlarmAction = errors.New("missing alarm action")
    ErrInvalidAlarm       = errors.New("invalid alarm type")
)

Errors.

var (
    ErrInvalidContentLine                 = errors.New("invalid content line")
    ErrInvalidContentLineName             = errors.New("invalid content line name")
    ErrInvalidContentLineParamName        = errors.New("invalid content line param name")
    ErrInvalidContentLineQuotedParamValue = errors.New("invalid content line quoted param value")
    ErrInvalidContentLineParamValue       = errors.New("invalid content line param value")
    ErrInvalidContentLineValue            = errors.New("invalid content line value")
)

Errors.

var (
    ErrInvalidEncoding        = errors.New("invalid Binary encoding")
    ErrInvalidPeriod          = errors.New("invalid Period")
    ErrInvalidDuration        = errors.New("invalid Duration")
    ErrInvalidText            = errors.New("invalid encoded text")
    ErrInvalidBoolean         = errors.New("invalid Boolean")
    ErrInvalidOffset          = errors.New("invalid UTC Offset")
    ErrInvalidRecur           = errors.New("invalid Recur")
    ErrInvalidTime            = errors.New("invalid Time")
    ErrInvalidFloat           = errors.New("invalid float")
    ErrInvalidTFloat          = errors.New("invalid number of floats")
    ErrInvalidPeriodStart     = errors.New("invalid start of Period")
    ErrInvalidPeriodDuration  = errors.New("invalid Period duration")
    ErrInvalidPeriodEnd       = errors.New("invalid end of Period")
    ErrInvalidRecurFrequency  = errors.New("invalid Recur frequency")
    ErrInvalidRecurBySecond   = errors.New("invalid Recur BySecond")
    ErrInvalidRecurByMinute   = errors.New("invalid Recur ByMinute")
    ErrInvalidRecurByHour     = errors.New("invalid Recur ByHour")
    ErrInvalidRecurByDay      = errors.New("invalid Recur ByDay")
    ErrInvalidRecurByMonthDay = errors.New("invalid Recur ByMonthDay")
    ErrInvalidRecurByYearDay  = errors.New("invalid Recur ByYearDay")
    ErrInvalidRecurByWeekNum  = errors.New("invalid Recur ByWeekNum")
    ErrInvalidRecurByMonth    = errors.New("invalid Recur ByMonth")
    ErrInvalidRecurBySetPos   = errors.New("invalid Recur BySetPos")
    ErrInvalidRecurWeekStart  = errors.New("invalid Recur WeekStart")
)

Errors.

var (
    ErrDuplicateParam = errors.New("duplicate param")
)

Errors..

var (
    ErrInvalidCalendar = errors.New("invalid calendar")
)

Errors.

func Encode

func Encode(w io.Writer, cal *Calendar) error

Encode encodes the given iCalendar object into the writer. It first validates the iCalendar object so as not to write invalid data to the writer.

type Alarm

type Alarm struct {
    AlarmType
}

Alarm is the encompassing type for the three alarm types.

type AlarmAudio

type AlarmAudio struct {
    Trigger       PropTrigger
    Duration      *PropDuration
    Repeat        *PropRepeat
    Attachment    []PropAttachment
    UID           *PropUID
    AlarmAgent    []PropAlarmAgent
    AlarmStatus   *PropAlarmStatus
    LastTriggered []PropLastTriggered
    Acknowledged  *PropAcknowledged
    Proximity     *PropProximity
    GeoLocation   []PropGeoLocation
    RelatedTo     *PropRelatedTo
    DefaultAlarm  *PropDefaultAlarm
}

AlarmAudio provides a group of components that define an Audio Alarm.

func (AlarmAudio) Type

func (AlarmAudio) Type() string

Type returns the type of the alarm "AUDIO".

type AlarmDisplay

type AlarmDisplay struct {
    Description   PropDescription
    Trigger       PropTrigger
    Duration      *PropDuration
    Repeat        *PropRepeat
    UID           *PropUID
    AlarmAgent    []PropAlarmAgent
    AlarmStatus   *PropAlarmStatus
    LastTriggered []PropLastTriggered
    Acknowledged  *PropAcknowledged
    Proximity     *PropProximity
    GeoLocation   []PropGeoLocation
    RelatedTo     *PropRelatedTo
    DefaultAlarm  *PropDefaultAlarm
}

AlarmDisplay provides a group of components that define a Display Alarm.

func (AlarmDisplay) Type

func (AlarmDisplay) Type() string

Type returns the type of the alarm "DISPLAY".

type AlarmEmail

type AlarmEmail struct {
    Description   PropDescription
    Trigger       PropTrigger
    Summary       PropSummary
    Attendee      *PropAttendee
    Duration      *PropDuration
    Repeat        *PropRepeat
    UID           *PropUID
    AlarmAgent    []PropAlarmAgent
    AlarmStatus   *PropAlarmStatus
    LastTriggered []PropLastTriggered
    Acknowledged  *PropAcknowledged
    Proximity     *PropProximity
    GeoLocation   []PropGeoLocation
    RelatedTo     *PropRelatedTo
    DefaultAlarm  *PropDefaultAlarm
}

AlarmEmail provides a group of components that define an Email Alarm.

func (AlarmEmail) Type

func (AlarmEmail) Type() string

Type returns the type of the alarm "EMAIL".

type AlarmNone

type AlarmNone struct{}

AlarmNone.

func (AlarmNone) Type

func (AlarmNone) Type() string

Type returns the type of the alarm "NONE".

type AlarmType

type AlarmType interface {
    Type() string
    // contains filtered or unexported methods
}

AlarmType is an interface this is fulfilled by AlarmAudio, AlarmDisplay and AlarmEmail.

type AlarmURI

type AlarmURI struct {
    URI           PropURI
    Duration      *PropDuration
    Repeat        *PropRepeat
    UID           *PropUID
    AlarmAgent    []PropAlarmAgent
    AlarmStatus   *PropAlarmStatus
    LastTriggered []PropLastTriggered
    Acknowledged  *PropAcknowledged
    Proximity     *PropProximity
    GeoLocation   []PropGeoLocation
    RelatedTo     *PropRelatedTo
    DefaultAlarm  *PropDefaultAlarm
}

AlarmURI provides a group of components that define a URI Alarm.

func (AlarmURI) Type

func (AlarmURI) Type() string

Type returns the type of the alarm "URI".

type Binary

type Binary []byte

Binary is inline binary data.

type Boolean

type Boolean bool

Boolean is true or false.

type Calendar

type Calendar struct {
    Version   PropVersion
    ProductID PropProductID
    Event     []Event
    Todo      []Todo
    Journal   []Journal
    FreeBusy  []FreeBusy
    Timezone  []Timezone
}

Calendar represents a iCalendar object.

func Decode

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

Decode decodes an iCalendar object from the given reader.

type CalendarAddress

type CalendarAddress struct {
    url.URL
}

CalendarAddress contains a calendar user address.

type Date

type Date struct {
    time.Time
}

Date is a Calendar Data.

type DateTime

type DateTime struct {
    time.Time
}

DateTime is a Calendar Date and Time.

type DayRecur

type DayRecur struct {
    Day        WeekDay
    Occurrence int8
}

DayRecur is used to reprent the nth day in a time period, be it 2nd Monday in a Month, or 31st Friday in a year, etc.

type Daylight

type Daylight struct {
    DateTimeStart       PropDateTimeStart
    TimezoneOffsetTo    PropTimezoneOffsetTo
    TimezoneOffsetFrom  PropTimezoneOffsetFrom
    RecurrenceRule      *PropRecurrenceRule
    Comment             []PropComment
    RecurrenceDateTimes []PropRecurrenceDateTimes
    TimezoneName        []PropTimezoneName
}

Daylight represents daylight savings timezone rules.

type Duration

type Duration struct {
    Negative                             bool
    Weeks, Days, Hours, Minutes, Seconds uint
}

Duration is a duration of time.

type Event

type Event struct {
    DateTimeStamp       PropDateTimeStamp
    UID                 PropUID
    DateTimeStart       *PropDateTimeStart
    Class               *PropClass
    Created             *PropCreated
    Description         *PropDescription
    Geo                 *PropGeo
    LastModified        *PropLastModified
    Location            *PropLocation
    Organizer           *PropOrganizer
    Priority            *PropPriority
    Sequence            *PropSequence
    Status              *PropStatus
    Summary             *PropSummary
    TimeTransparency    *PropTimeTransparency
    URL                 *PropURL
    RecurrenceID        *PropRecurrenceID
    RecurrenceRule      *PropRecurrenceRule
    DateTimeEnd         *PropDateTimeEnd
    Duration            *PropDuration
    Attachment          []PropAttachment
    Attendee            []PropAttendee
    Categories          []PropCategories
    Comment             []PropComment
    Contact             []PropContact
    ExceptionDateTime   []PropExceptionDateTime
    RequestStatus       []PropRequestStatus
    RelatedTo           []PropRelatedTo
    Resources           []PropResources
    RecurrenceDateTimes []PropRecurrenceDateTimes
    Alarm               []Alarm
}

Event provides a group of components that describe an event.

type Float

type Float float64

Float contains a real-number value.

type FreeBusy

type FreeBusy struct {
    DateTimeStamp PropDateTimeStamp
    UID           PropUID
    Contact       *PropContact
    DateTimeStart *PropDateTimeStart
    DateTimeEnd   *PropDateTimeEnd
    Organizer     *PropOrganizer
    URL           *PropURL
    Attendee      []PropAttendee
    Comment       []PropComment
    FreeBusy      []PropFreeBusy
    RequestStatus []PropRequestStatus
}

FreeBusy provides a group of components that describe either a request for free/busy time, describe a response to a request for free/busy time, or describe a published set of busy time.

type Frequency

type Frequency uint8

Frequency represents the Recurrence frequency.

const (
    Secondly Frequency = iota
    Minutely
    Hourly
    Daily
    Weekly
    Monthly
    Yearly
)

Frequency constant values.

type Integer

type Integer int32

Integer is a signed integer value.

type Journal

type Journal struct {
    DateTimeStamp       PropDateTimeStamp
    UID                 PropUID
    Class               *PropClass
    Created             *PropCreated
    DateTimeStart       *PropDateTimeStart
    LastModified        *PropLastModified
    Organizer           *PropOrganizer
    RecurrenceID        *PropRecurrenceID
    Sequence            *PropSequence
    Status              *PropStatus
    Summary             *PropSummary
    URL                 *PropURL
    RecurrenceRule      *PropRecurrenceRule
    Attachment          []PropAttachment
    Attendee            []PropAttendee
    Categories          []PropCategories
    Comment             []PropComment
    Contact             []PropContact
    Description         []PropDescription
    ExceptionDateTime   []PropExceptionDateTime
    RequestStatus       []PropRequestStatus
    RelatedTo           []PropRelatedTo
    Resources           []PropResources
    RecurrenceDateTimes []PropRecurrenceDateTimes
}

Journal provides a group of components that describe a journal entry.

type MText

type MText []Text

MText contains multiple text values.

type Month

type Month uint8

Month is a numeric representation of a Month of the Year.

const (
    UnknownMonth Month = iota
    January
    February
    March
    April
    May
    June
    July
    August
    September
    October
    November
    December
)

Month Constant Values.

type ParamAgentID

type ParamAgentID string

ParamAgentID.

func NewAgentID

func NewAgentID(v ParamAgentID) *ParamAgentID

NewAgentID returns a *ParamAgentID for ease of use with optional values.

type ParamAlternativeRepresentation

type ParamAlternativeRepresentation URI

ParamAlternativeRepresentation.

type ParamCalendarUserType

type ParamCalendarUserType uint8

ParamCalendarUserType.

const (
    CalendarUserTypeUnknown ParamCalendarUserType = iota
    CalendarUserTypeIndividual
    CalendarUserTypeGroup
    CalendarUserTypeResource
    CalendarUserTypeRoom
)

CalendarUserType constant values.

func (ParamCalendarUserType) New

func (t ParamCalendarUserType) New() *ParamCalendarUserType

New returns a pointer to the type (used with constants for ease of use with optional values).

type ParamCommonName

type ParamCommonName string

ParamCommonName.

func NewCommonName

func NewCommonName(v ParamCommonName) *ParamCommonName

NewCommonName returns a *ParamCommonName for ease of use with optional values.

type ParamDelagatee

type ParamDelagatee []CalendarAddress

ParamDelagatee.

type ParamDelegator

type ParamDelegator []CalendarAddress

ParamDelegator.

type ParamDirectoryEntry

type ParamDirectoryEntry string

ParamDirectoryEntry.

func NewDirectoryEntry

func NewDirectoryEntry(v ParamDirectoryEntry) *ParamDirectoryEntry

NewDirectoryEntry returns a *ParamDirectoryEntry for ease of use with optional values.

type ParamEncoding

type ParamEncoding uint8

ParamEncoding.

const (
    Encoding8bit ParamEncoding = iota
    EncodingBase64
)

Encoding constant values.

func (ParamEncoding) New

func (t ParamEncoding) New() *ParamEncoding

New returns a pointer to the type (used with constants for ease of use with optional values).

type ParamFormatType

type ParamFormatType string

ParamFormatType.

func NewFormatType

func NewFormatType(v ParamFormatType) *ParamFormatType

NewFormatType returns a *ParamFormatType for ease of use with optional values.

type ParamFreeBusyType

type ParamFreeBusyType uint8

ParamFreeBusyType.

const (
    FreeBusyTypeUnknown ParamFreeBusyType = iota
    FreeBusyTypeFree
    FreeBusyTypeBusy
    FreeBusyTypeBusyUnavailable
    FreeBusyTypeBusyTentative
)

FreeBusyType constant values.

func (ParamFreeBusyType) New

func (t ParamFreeBusyType) New() *ParamFreeBusyType

New returns a pointer to the type (used with constants for ease of use with optional values).

type ParamID

type ParamID string

ParamID.

func NewID

func NewID(v ParamID) *ParamID

NewID returns a *ParamID for ease of use with optional values.

type ParamLanguage

type ParamLanguage string

ParamLanguage.

func NewLanguage

func NewLanguage(v ParamLanguage) *ParamLanguage

NewLanguage returns a *ParamLanguage for ease of use with optional values.

type ParamMember

type ParamMember []string

ParamMember.

func NewMember

func NewMember(v ParamMember) *ParamMember

NewMember returns a *ParamMember for ease of use with optional values.

type ParamParticipationRole

type ParamParticipationRole uint8

ParamParticipationRole.

const (
    ParticipationRoleUnknown ParamParticipationRole = iota
    ParticipationRoleRequiredParticipant
    ParticipationRoleChair
    ParticipationRoleOptParticipant
    ParticipationRoleNonParticipant
)

ParticipationRole constant values.

func (ParamParticipationRole) New

func (t ParamParticipationRole) New() *ParamParticipationRole

New returns a pointer to the type (used with constants for ease of use with optional values).

type ParamParticipationStatus

type ParamParticipationStatus uint8

ParamParticipationStatus.

const (
    ParticipationStatusUnknown ParamParticipationStatus = iota
    ParticipationStatusNeedsAction
    ParticipationStatusAccepted
    ParticipationStatusDeclined
    ParticipationStatusTentative
    ParticipationStatusDelegated
    ParticipationStatusCompleted
    ParticipationStatusInProcess
)

ParticipationStatus constant values.

func (ParamParticipationStatus) New

func (t ParamParticipationStatus) New() *ParamParticipationStatus

New returns a pointer to the type (used with constants for ease of use with optional values).

type ParamRSVP

type ParamRSVP Boolean

ParamRSVP.

func NewRSVP

func NewRSVP(v ParamRSVP) *ParamRSVP

NewRSVP returns a *ParamRSVP for ease of use with optional values.

type ParamRange

type ParamRange struct{}

ParamRange.

type ParamRelated

type ParamRelated uint8

ParamRelated.

const (
    RelatedStart ParamRelated = iota
    RelatedEnd
)

Related constant values.

func (ParamRelated) New

func (t ParamRelated) New() *ParamRelated

New returns a pointer to the type (used with constants for ease of use with optional values).

type ParamRelationshipType

type ParamRelationshipType uint8

ParamRelationshipType.

const (
    RelationshipTypeUnknown ParamRelationshipType = iota
    RelationshipTypeParent
    RelationshipTypeChild
    RelationshipTypeSibling
)

RelationshipType constant values.

func (ParamRelationshipType) New

func (t ParamRelationshipType) New() *ParamRelationshipType

New returns a pointer to the type (used with constants for ease of use with optional values).

type ParamSentBy

type ParamSentBy string

ParamSentBy.

func NewSentBy

func NewSentBy(v ParamSentBy) *ParamSentBy

NewSentBy returns a *ParamSentBy for ease of use with optional values.

type ParamTimezoneID

type ParamTimezoneID string

ParamTimezoneID.

func NewTimezoneID

func NewTimezoneID(v ParamTimezoneID) *ParamTimezoneID

NewTimezoneID returns a *ParamTimezoneID for ease of use with optional values.

type ParamURI

type ParamURI URI

ParamURI.

type ParamValue

type ParamValue uint8

ParamValue.

const (
    ValueUnknown ParamValue = iota
    ValueBinary
    ValueBoolean
    ValueCalendarAddress
    ValueDate
    ValueDateTime
    ValueDuration
    ValueFloat
    ValueInteger
    ValuePeriod
    ValueRecur
    ValueText
    ValueTime
    ValueURI
    ValueUTCOffset
)

Value constant values.

func (ParamValue) New

func (t ParamValue) New() *ParamValue

New returns a pointer to the type (used with constants for ease of use with optional values).

type Period

type Period struct {
    Start, End DateTime
    Duration   Duration
}

Period represents a precise period of time/

Only one of End or Duration will be used. If Period.End.IsZero() is true, then it uses Period.Duration.

type PropAcknowledged

type PropAcknowledged DateTime

PropAcknowledged.

type PropAction

type PropAction uint8

PropAction defines the action to be invoked when an alarm is triggered.

const (
    ActionAudio PropAction = iota
    ActionDisplay
    ActionEmail
)

PropAction constant values.

func (PropAction) New

func (p PropAction) New() *PropAction

New returns a pointer to the type (used with constants for ease of use with optional values).

type PropAlarmAgent

type PropAlarmAgent struct {
    URI     *ParamURI
    ID      *ParamID
    AgentID *ParamAgentID
    Text
}

PropAlarmAgent.

type PropAlarmStatus

type PropAlarmStatus uint8

PropAlarmStatus.

const (
    AlarmStatusActive PropAlarmStatus = iota
    AlarmStatusCancelled
    AlarmStatusCompleted
)

PropAlarmStatus constant values.

func (PropAlarmStatus) New

func (p PropAlarmStatus) New() *PropAlarmStatus

New returns a pointer to the type (used with constants for ease of use with optional values).

type PropAttachment

type PropAttachment struct {
    FormatType *ParamFormatType
    URI        *URI
    Binary     *Binary
}

PropAttachment provides the capability to associate a document object with a calendar component.

type PropAttendee

type PropAttendee struct {
    CalendarUserType    *ParamCalendarUserType
    Member              ParamMember
    ParticipationRole   *ParamParticipationRole
    ParticipationStatus *ParamParticipationStatus
    RSVP                *ParamRSVP
    Delagatee           ParamDelagatee
    Delegator           ParamDelegator
    SentBy              *ParamSentBy
    CommonName          *ParamCommonName
    DirectoryEntry      *ParamDirectoryEntry
    Language            *ParamLanguage
    CalendarAddress
}

PropAttendee defines an "Attendee" within a calendar component.

type PropCalendarScale

type PropCalendarScale uint8

PropCalendarScale defines the calendar scale.

const (
    CalendarScaleGregorian PropCalendarScale = iota
)

PropCalendarScale constant values.

func (PropCalendarScale) New

func (p PropCalendarScale) New() *PropCalendarScale

New returns a pointer to the type (used with constants for ease of use with optional values).

type PropCategories

type PropCategories struct {
    Language *ParamLanguage
    MText
}

PropCategories defines the categories for a calendar component.

type PropClass

type PropClass uint8

PropClass defines the access classification for a calendar component.

const (
    ClassPublic PropClass = iota
    ClassPrivate
    ClassConfidential
)

PropClass constant values.

func (PropClass) New

func (p PropClass) New() *PropClass

New returns a pointer to the type (used with constants for ease of use with optional values).

type PropComment

type PropComment struct {
    AlternativeRepresentation *ParamAlternativeRepresentation
    Language                  *ParamLanguage
    Text
}

PropComment specifies non-processing information intended to provide a comment to the calendar user.

type PropCompleted

type PropCompleted DateTime

PropCompleted defines the date and time that a to-do was actually completed.

type PropContact

type PropContact struct {
    AlternativeRepresentation *ParamAlternativeRepresentation
    Language                  *ParamLanguage
    Text
}

PropContact is used to represent contact information or alternately a reference to contact information associated with the calendar component.

type PropCreated

type PropCreated DateTime

PropCreated specifies the date and time that the calendar information was created by the calendar user agent in the calendar store.

type PropDateTimeEnd

type PropDateTimeEnd struct {
    DateTime *DateTime
    Date     *Date
}

PropDateTimeEnd specifies the date and time that a calendar component ends.

type PropDateTimeStamp

type PropDateTimeStamp DateTime

PropDateTimeStamp specifies the date and time that the calendar object was created unless the calendar object has no METHOD property, in which case it specifies the date and time that the information with the calendar was last revised.

type PropDateTimeStart

type PropDateTimeStart struct {
    DateTime *DateTime
    Date     *Date
}

PropDateTimeStart specifies when the calendar component begins.

type PropDefaultAlarm

type PropDefaultAlarm Boolean

PropDefaultAlarm.

type PropDescription

type PropDescription struct {
    AlternativeRepresentation *ParamAlternativeRepresentation
    Language                  *ParamLanguage
    Text
}

PropDescription provides a more complete description of the calendar component than that provided by the "SUMMARY" property.

type PropDue

type PropDue struct {
    DateTime *DateTime
    Date     *Date
}

PropDue defines the date and time that a to-do is expected to be completed.

type PropDuration

type PropDuration Duration

PropDuration specifies a positive duration of time.

type PropExceptionDateTime

type PropExceptionDateTime struct {
    DateTime *DateTime
    Date     *Date
}

PropExceptionDateTime defines the list of DATE-TIME exceptions for recurring events, to-dos, journal entries, or time zone definitions.

type PropFreeBusy

type PropFreeBusy struct {
    FreeBusyType *ParamFreeBusyType
    Period
}

PropFreeBusy defines one or more free or busy time intervals.

type PropGeo

type PropGeo TFloat

PropGeo specifies information related to the global position for the activity specified by a calendar component.

type PropGeoLocation

type PropGeoLocation URI

PropGeoLocation.

type PropLastModified

type PropLastModified DateTime

PropLastModified specifies the date and time that the information associated with the calendar component was last revised in the calendar store.

type PropLastTriggered

type PropLastTriggered DateTime

PropLastTriggered.

type PropLocation

type PropLocation struct {
    AlternativeRepresentation *ParamAlternativeRepresentation
    Language                  *ParamLanguage
    Text
}

PropLocation defines the intended venue for the activity defined by a calendar component.

type PropMethod

type PropMethod Text

PropMethod defines the iCalendar object method associated with the calendar object.

type PropOrganizer

type PropOrganizer struct {
    CommonName     *ParamCommonName
    DirectoryEntry *ParamDirectoryEntry
    SentBy         *ParamSentBy
    Language       *ParamLanguage
    CalendarAddress
}

PropOrganizer defines the organizer for a calendar component.

type PropPercentComplete

type PropPercentComplete Integer

PropPercentComplete is used by an assignee or delegatee of a to-do to convey the percent completion of a to-do to the "Organizer".

func NewPercentComplete

func NewPercentComplete(v PropPercentComplete) *PropPercentComplete

NewPercentComplete generates a pointer to a constant value. Used when manually creating Calendar values.

type PropPriority

type PropPriority Integer

PropPriority defines the relative priority for a calendar component.

func NewPriority

func NewPriority(v PropPriority) *PropPriority

NewPriority generates a pointer to a constant value. Used when manually creating Calendar values.

type PropProductID

type PropProductID Text

PropProductID specifies the identifier for the product that created the iCalendar object.

type PropProximity

type PropProximity Text

PropProximity.

type PropRecurrenceDateTimes

type PropRecurrenceDateTimes struct {
    DateTime *DateTime
    Date     *Date
    Period   *Period
}

PropRecurrenceDateTimes defines the list of DATE-TIME values for recurring events, to-dos, journal entries, or time zone definitions.

type PropRecurrenceID

type PropRecurrenceID struct {
    Range    *ParamRange
    DateTime *DateTime
    Date     *Date
}

PropRecurrenceID is used to identify a specific instance of a recurring Event, Todo or Journal.

type PropRecurrenceRule

type PropRecurrenceRule Recur

PropRecurrenceRule defines a rule or repeating pattern for recurring events, to-dos, journal entries, or time zone definitions.

type PropRelatedTo

type PropRelatedTo struct {
    RelationshipType *ParamRelationshipType
    Text
}

PropRelatedTo is used to represent a relationship or reference between one calendar component and another.

type PropRepeat

type PropRepeat Integer

PropRepeat defines the number of times the alarm should be repeated, after the initial trigger.

func NewRepeat

func NewRepeat(v PropRepeat) *PropRepeat

NewRepeat generates a pointer to a constant value. Used when manually creating Calendar values.

type PropRequestStatus

type PropRequestStatus Text

PropRequestStatus defines the status code returned for a scheduling request.

type PropResources

type PropResources struct {
    AlternativeRepresentation *ParamAlternativeRepresentation
    Language                  *ParamLanguage
    MText
}

PropResources defines the equipment or resources anticipated for an activity specified by a calendar component.

type PropSequence

type PropSequence Integer

PropSequence defines the revision sequence number of the calendar component within a sequence of revisions.

func NewSequence

func NewSequence(v PropSequence) *PropSequence

NewSequence generates a pointer to a constant value. Used when manually creating Calendar values.

type PropStatus

type PropStatus uint8

PropStatus defines the overall status or confirmation for the calendar component.

const (
    StatusTentative PropStatus = iota
    StatusConfirmed
    StatusCancelled
    StatusNeedsAction
    StatusCompleted
    StatusInProcess
    StatusDraft
    StatusFinal
)

PropStatus constant values.

func (PropStatus) New

func (p PropStatus) New() *PropStatus

New returns a pointer to the type (used with constants for ease of use with optional values).

type PropSummary

type PropSummary struct {
    AlternativeRepresentation *ParamAlternativeRepresentation
    Language                  *ParamLanguage
    Text
}

PropSummary defines a short summary or subject for the calendar component.

type PropTimeTransparency

type PropTimeTransparency uint8

PropTimeTransparency defines whether or not an event is transparent to busy time searches.

const (
    TimeTransparencyOpaque PropTimeTransparency = iota
    TimeTransparencyTransparent
)

PropTimeTransparency constant values.

func (PropTimeTransparency) New

func (p PropTimeTransparency) New() *PropTimeTransparency

New returns a pointer to the type (used with constants for ease of use with optional values).

type PropTimezoneID

type PropTimezoneID Text

PropTimezoneID specifies the text value that uniquely identifies the "VTIMEZONE" calendar component in the scope of an iCalendar object.

type PropTimezoneName

type PropTimezoneName struct {
    Language *ParamLanguage
    Text
}

PropTimezoneName specifies the customary designation for a time zone description.

type PropTimezoneOffsetFrom

type PropTimezoneOffsetFrom UTCOffset

PropTimezoneOffsetFrom specifies the offset that is in use prior to this time zone observance.

type PropTimezoneOffsetTo

type PropTimezoneOffsetTo UTCOffset

PropTimezoneOffsetTo specifies the offset that is in use in this time zone observance.

type PropTimezoneURL

type PropTimezoneURL URI

PropTimezoneURL provides a means for a "VTIMEZONE" component to point to a network location that can be used to retrieve an up- to-date version of itself.

type PropTrigger

type PropTrigger struct {
    Duration *Duration
    DateTime *DateTime
}

PropTrigger specifies when an alarm will trigger.

type PropUID

type PropUID Text

PropUID defines the persistent, globally unique identifier for the calendar component.

type PropURI

type PropURI URI

PropURI.

type PropURL

type PropURL URI

PropURL defines a Uniform Resource Locator associated with the iCalendar object.

type PropVersion

type PropVersion Text

PropVersion specifies the identifier corresponding to the highest version number or the minimum and maximum range of the iCalendar specification that is required in order to interpret the iCalendar object.

type Recur

type Recur struct {
    Frequency  Frequency
    WeekStart  WeekDay
    UntilTime  bool
    Until      time.Time
    Count      uint64
    Interval   uint64
    BySecond   []uint8
    ByMinute   []uint8
    ByHour     []uint8
    ByDay      []DayRecur
    ByMonthDay []int8
    ByYearDay  []int16
    ByWeekNum  []int8
    ByMonth    []Month
    BySetPos   []int16
}

Recur contains a recurrence rule specification.

type Standard

type Standard struct {
    DateTimeStart       PropDateTimeStart
    TimezoneOffsetTo    PropTimezoneOffsetTo
    TimezoneOffsetFrom  PropTimezoneOffsetFrom
    RecurrenceRule      *PropRecurrenceRule
    Comment             []PropComment
    RecurrenceDateTimes []PropRecurrenceDateTimes
    TimezoneName        []PropTimezoneName
}

Standard represents standard timezone rules.

type TFloat

type TFloat [2]float64

TFloat is a pair of float values used for coords.

type Text

type Text string

Text contains human-readable text.

type Time

type Time struct {
    time.Time
}

Time contains a precise time.

type Timezone

type Timezone struct {
    TimezoneID   PropTimezoneID
    LastModified *PropLastModified
    TimezoneURL  *PropTimezoneURL
    Standard     []Standard
    Daylight     []Daylight
}

Timezone provide a group of components that defines a time zone.

type Todo

type Todo struct {
    DateTimeStamp       PropDateTimeStamp
    UID                 PropUID
    Class               *PropClass
    Completed           *PropCompleted
    Created             *PropCreated
    Description         *PropDescription
    DateTimeStart       *PropDateTimeStart
    Geo                 *PropGeo
    LastModified        *PropLastModified
    Location            *PropLocation
    Organizer           *PropOrganizer
    PercentComplete     *PropPercentComplete
    Priority            *PropPriority
    RecurrenceID        *PropRecurrenceID
    Sequence            *PropSequence
    Status              *PropStatus
    Summary             *PropSummary
    URL                 *PropURL
    Due                 *PropDue
    Duration            *PropDuration
    Attachment          []PropAttachment
    Attendee            []PropAttendee
    Categories          []PropCategories
    Comment             []PropComment
    Contact             []PropContact
    ExceptionDateTime   []PropExceptionDateTime
    RequestStatus       []PropRequestStatus
    RelatedTo           []PropRelatedTo
    Resources           []PropResources
    RecurrenceDateTimes []PropRecurrenceDateTimes
    Alarm               []Alarm
}

Todo provides a group of components that describe a to-do.

type URI

type URI struct {
    url.URL
}

URI contains a reference to another piece of data.

type UTCOffset

type UTCOffset int

UTCOffset contains the offset from UTC to local time.

type WeekDay

type WeekDay uint8

WeekDay is a numeric representation of a Day of the Week.

const (
    UnknownDay WeekDay = iota
    Sunday
    Monday
    Tuesday
    Wednesday
    Thursday
    Friday
    Saturday
)

Weekday constant values.