ics

package module
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: Apache-2.0 Imports: 16 Imported by: 159

README

golang-ical

A ICS / ICal parser and serialiser for Golang.

GoDoc

Because the other libraries didn't quite do what I needed.

Usage, parsing:

    cal, err := ParseCalendar(strings.NewReader(input))

Usage, parsing from a URL:

    cal, err := ParseCalendarFromUrl("https://your-ics-url")

Creating:

  cal := ics.NewCalendar()
  cal.SetMethod(ics.MethodRequest)
  event := cal.AddEvent(fmt.Sprintf("id@domain", p.SessionKey.IntID()))
  event.SetCreatedTime(time.Now())
  event.SetDtStampTime(time.Now())
  event.SetModifiedAt(time.Now())
  event.SetStartAt(time.Now())
  event.SetEndAt(time.Now())
  event.SetSummary("Summary")
  event.SetLocation("Address")
  event.SetDescription("Description")
  event.SetURL("https://URL/")
  event.AddRrule(fmt.Sprintf("FREQ=YEARLY;BYMONTH=%d;BYMONTHDAY=%d", time.Now().Month(), time.Now().Day()))
  event.SetOrganizer("sender@domain", ics.WithCN("This Machine"))
  event.AddAttendee("reciever or participant", ics.CalendarUserTypeIndividual, ics.ParticipationStatusNeedsAction, ics.ParticipationRoleReqParticipant, ics.WithRSVP(true))
  return cal.Serialize()

Helper methods created as needed feel free to send a P.R. with more.

Working with Recurring Events

This library parses and provides typed access to recurrence properties (RRULE, RDATE, EXDATE, EXRULE, RECURRENCE-ID) but does not expand them into concrete occurrence dates. This keeps the library dependency-free and lets callers choose their own expansion strategy.

Accessing recurrence properties

  // Parse RRULE into a structured type
  rules, err := event.GetRRules()
  for _, rule := range rules {
      fmt.Println(rule.Freq)       // e.g. ics.FrequencyYearly
      fmt.Println(rule.ByMonth)    // e.g. [10]
      fmt.Println(rule.ByDay)      // e.g. [{OrdWeek:-1 Day:SU}]
      fmt.Println(rule.Count)      // e.g. 10
      fmt.Println(rule.Interval)   // e.g. 1
  }

  // Get excluded dates (handles comma-separated values and multiple properties)
  exDates, err := event.GetExDates()    // []time.Time
  rDates, err := event.GetRDates()      // []time.Time

  // Get recurrence ID (for modified/cancelled occurrences)
  recID, err := event.GetRecurrenceID() // time.Time

  // Serialize a RecurrenceRule back to RRULE format
  rule, _ := ics.ParseRecurrenceRule("FREQ=WEEKLY;INTERVAL=2;BYDAY=MO,WE,FR")
  fmt.Println(rule.String()) // "FREQ=WEEKLY;INTERVAL=2;BYDAY=MO,WE,FR"

Expanding occurrences with rrule-go

To expand recurring events into concrete dates, use a library like rrule-go:

  import (
      "github.com/arran4/golang-ical"
      "github.com/teambition/rrule-go"
  )

  // Parse your calendar
  cal, _ := ics.ParseCalendar(reader)

  for _, event := range cal.Events() {
      dtstart, _ := event.GetStartAt()
      dtend, _ := event.GetEndAt()
      duration := dtend.Sub(dtstart)

      // Build an RRuleSet from the event's recurrence properties
      set := &rrule.Set{}

      rules, _ := event.GetRRules()
      for _, r := range rules {
          rr, _ := rrule.StrToRRule(r.String())
          rr.DTStart(dtstart)
          set.RRule(rr)
      }

      rDates, _ := event.GetRDates()
      for _, rd := range rDates {
          set.RDate(rd)
      }

      exDates, _ := event.GetExDates()
      for _, exd := range exDates {
          set.ExDate(exd)
      }

      // Get all occurrences in a time range
      occurrences := set.Between(rangeStart, rangeEnd, true)

      // Each occurrence is a start time; compute the end from the original duration
      for _, occ := range occurrences {
          fmt.Printf("  %s to %s\n", occ, occ.Add(duration))
      }
  }
Handling RECURRENCE-ID overrides

Calendar feeds use RECURRENCE-ID to modify or cancel individual occurrences of a recurring event. These appear as separate VEVENTs with the same UID but a RECURRENCE-ID property indicating which occurrence they replace.

  type overrideKey struct {
      UID   string
      Start time.Time
  }

  overrides := map[overrideKey]*ics.VEvent{}
  var regularEvents []*ics.VEvent

  for _, event := range cal.Events() {
      recID, err := event.GetRecurrenceID()
      if err == nil {
          uid := event.GetProperty(ics.ComponentPropertyUniqueId).Value
          overrides[overrideKey{UID: uid, Start: recID}] = event
      } else {
          regularEvents = append(regularEvents, event)
      }
  }

  // After expanding occurrences from regularEvents, check each generated
  // occurrence against the overrides map. If a match is found, replace that
  // occurrence with the override's times/properties (or remove it if the
  // override represents a cancellation).

Notice

Looking for a co-maintainer.

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
	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)
	ComponentPropertyPriority        = ComponentProperty(PropertyPriority)
	ComponentPropertyResources       = ComponentProperty(PropertyResources)
	ComponentPropertyCompleted       = ComponentProperty(PropertyCompleted)
	ComponentPropertyDue             = ComponentProperty(PropertyDue)
	ComponentPropertyPercentComplete = ComponentProperty(PropertyPercentComplete)
	ComponentPropertyTzid            = ComponentProperty(PropertyTzid)
	ComponentPropertyComment         = ComponentProperty(PropertyComment)
	ComponentPropertyRelatedTo       = ComponentProperty(PropertyRelatedTo)
	ComponentPropertyMethod          = ComponentProperty(PropertyMethod)
	ComponentPropertyRecurrenceId    = ComponentProperty(PropertyRecurrenceId)
	ComponentPropertyDuration        = ComponentProperty(PropertyDuration)
	ComponentPropertyContact         = ComponentProperty(PropertyContact)
	ComponentPropertyRequestStatus   = ComponentProperty(PropertyRequestStatus)
	ComponentPropertyRDate           = ComponentProperty(PropertyRdate)
)
View Source
const (
	NewLine = WithNewLineUnix
)

Variables

View Source
var (
	// ErrorPropertyNotFound is the error returned if the requested valid
	// property is not set.
	ErrorPropertyNotFound = errors.New("property not found")
)

Functions

func AcceptUnknownPropertyHandler added in v0.3.3

func AcceptUnknownPropertyHandler(cal *Calendar, state string, cl *BaseProperty) error

AcceptUnknownPropertyHandler allows properties between components (non-standard but occurs in real-world ICS files) These properties are added to the calendar properties list

func DefaultUnknownCalendarPropertyHandler added in v0.3.3

func DefaultUnknownCalendarPropertyHandler(cal *Calendar, state string, cl *BaseProperty) error

func FromText

func FromText(s string) string

func SetGeo added in v0.3.3

func SetGeo[T GeoType](c SetPropertyOwner, lat T, lng T, params ...PropertyParameter)

func ToText

func ToText(s string) string

func WithCustomClient added in v0.3.2

func WithCustomClient(client *http.Client) *http.Client

func WithCustomRequest added in v0.3.2

func WithCustomRequest(request *http.Request) *http.Request

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 (p *Attendee) Email() string

func (*Attendee) ParticipationStatus

func (p *Attendee) ParticipationStatus() ParticipationStatus

type BaseProperty

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

func ParseProperty

func ParseProperty(contentLine ContentLine) (*BaseProperty, error)

func (*BaseProperty) GetValueType added in v0.3.0

func (bp *BaseProperty) GetValueType() ValueDataType

func (*BaseProperty) SerializeTo added in v0.3.4

func (bp *BaseProperty) SerializeTo(w io.Writer, serialConfig *SerializationConfiguration) error

type Calendar

type Calendar struct {
	Components         []Component
	CalendarProperties []CalendarProperty
	// contains filtered or unexported fields
}

func NewCalendar

func NewCalendar() *Calendar

func NewCalendarFor

func NewCalendarFor(service string) *Calendar

func ParseCalendar

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

func ParseCalendarFromUrl added in v0.3.2

func ParseCalendarFromUrl(url string, opts ...any) (*Calendar, error)

func ParseCalendarWithOptions added in v0.3.3

func ParseCalendarWithOptions(r io.Reader, options ...any) (*Calendar, error)

func (*Calendar) AddBusy added in v0.2.4

func (cal *Calendar) AddBusy(id string) *VBusy

func (*Calendar) AddEvent

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

func (*Calendar) AddJournal added in v0.2.4

func (cal *Calendar) AddJournal(id string) *VJournal

func (*Calendar) AddTimezone added in v0.2.4

func (cal *Calendar) AddTimezone(id string) *VTimezone

func (*Calendar) AddTodo added in v0.2.4

func (cal *Calendar) AddTodo(id string) *VTodo

func (*Calendar) AddVAlarm added in v0.2.4

func (cal *Calendar) AddVAlarm(e *VAlarm)

func (*Calendar) AddVBusy added in v0.2.4

func (cal *Calendar) AddVBusy(e *VBusy)

func (*Calendar) AddVEvent

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

func (*Calendar) AddVJournal added in v0.2.4

func (cal *Calendar) AddVJournal(e *VJournal)

func (*Calendar) AddVTimezone added in v0.2.4

func (cal *Calendar) AddVTimezone(e *VTimezone)

func (*Calendar) AddVTodo added in v0.2.4

func (cal *Calendar) AddVTodo(e *VTodo)

func (*Calendar) Alarms added in v0.2.4

func (cal *Calendar) Alarms() []*VAlarm

func (*Calendar) Busys added in v0.2.4

func (cal *Calendar) Busys() []*VBusy

func (*Calendar) Events

func (calendar *Calendar) Events() (r []*VEvent)

func (*Calendar) Journals added in v0.2.4

func (cal *Calendar) Journals() []*VJournal

func (*Calendar) RemoveEvent added in v0.2.1

func (calendar *Calendar) RemoveEvent(id string)

func (*Calendar) Serialize

func (cal *Calendar) Serialize(ops ...any) string

func (*Calendar) SerializeTo

func (cal *Calendar) SerializeTo(w io.Writer, ops ...any) error

func (*Calendar) SetCalscale

func (cal *Calendar) SetCalscale(s string, params ...PropertyParameter)

func (*Calendar) SetColor

func (cal *Calendar) SetColor(s string, params ...PropertyParameter)

func (*Calendar) SetDescription

func (cal *Calendar) SetDescription(s string, params ...PropertyParameter)

func (*Calendar) SetLastModified

func (cal *Calendar) SetLastModified(t time.Time, params ...PropertyParameter)

func (*Calendar) SetMethod

func (cal *Calendar) SetMethod(method Method, params ...PropertyParameter)

func (*Calendar) SetName

func (cal *Calendar) SetName(s string, params ...PropertyParameter)

func (*Calendar) SetProductId

func (cal *Calendar) SetProductId(s string, params ...PropertyParameter)

func (*Calendar) SetRefreshInterval

func (cal *Calendar) SetRefreshInterval(s string, params ...PropertyParameter)

func (*Calendar) SetTimezoneId

func (cal *Calendar) SetTimezoneId(s string, params ...PropertyParameter)

func (*Calendar) SetTzid

func (cal *Calendar) SetTzid(s string, params ...PropertyParameter)

func (*Calendar) SetUrl

func (cal *Calendar) SetUrl(s string, params ...PropertyParameter)

func (*Calendar) SetVersion

func (cal *Calendar) SetVersion(s string, params ...PropertyParameter)

func (*Calendar) SetXPublishedTTL

func (cal *Calendar) SetXPublishedTTL(s string, params ...PropertyParameter)

func (*Calendar) SetXWRCalDesc

func (cal *Calendar) SetXWRCalDesc(s string, params ...PropertyParameter)

func (*Calendar) SetXWRCalID

func (cal *Calendar) SetXWRCalID(s string, params ...PropertyParameter)

func (*Calendar) SetXWRCalName

func (cal *Calendar) SetXWRCalName(s string, params ...PropertyParameter)

func (*Calendar) SetXWRTimezone

func (cal *Calendar) SetXWRTimezone(s string, params ...PropertyParameter)

func (*Calendar) Timezones added in v0.2.4

func (cal *Calendar) Timezones() []*VTimezone

func (*Calendar) Todos added in v0.2.4

func (cal *Calendar) Todos() []*VTodo

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 (cs *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(_ ...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
	SerializeTo(b io.Writer, serialConfig *SerializationConfiguration) error
}

Component To determine what this is please use a type switch or typecast to each of: - *VEvent - *VTodo - *VBusy - *VJournal

func GeneralParseComponent

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

type ComponentBase

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

func NewComponent added in v0.2.4

func NewComponent(uniqueId string) ComponentBase

func ParseComponent

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

func (*ComponentBase) AddAttachment added in v0.2.4

func (cb *ComponentBase) AddAttachment(s string, params ...PropertyParameter)

func (*ComponentBase) AddAttachmentBinary added in v0.2.4

func (cb *ComponentBase) AddAttachmentBinary(binary []byte, contentType string)

func (*ComponentBase) AddAttachmentURL added in v0.2.4

func (cb *ComponentBase) AddAttachmentURL(uri string, contentType string)

func (*ComponentBase) AddAttendee added in v0.2.4

func (cb *ComponentBase) AddAttendee(s string, params ...PropertyParameter)

func (*ComponentBase) AddCategory added in v0.2.4

func (cb *ComponentBase) AddCategory(s string, params ...PropertyParameter)

func (*ComponentBase) AddComment added in v0.2.4

func (cb *ComponentBase) AddComment(s string, params ...PropertyParameter)

func (*ComponentBase) AddExdate added in v0.2.4

func (cb *ComponentBase) AddExdate(s string, params ...PropertyParameter)

func (*ComponentBase) AddExrule added in v0.2.4

func (cb *ComponentBase) AddExrule(s string, params ...PropertyParameter)

func (*ComponentBase) AddProperty

func (cb *ComponentBase) AddProperty(property ComponentProperty, value string, params ...PropertyParameter)

AddProperty appends a property

func (*ComponentBase) AddRdate added in v0.2.4

func (cb *ComponentBase) AddRdate(s string, params ...PropertyParameter)

func (*ComponentBase) AddRrule added in v0.2.4

func (cb *ComponentBase) AddRrule(s string, params ...PropertyParameter)

func (*ComponentBase) Attendees added in v0.2.4

func (cb *ComponentBase) Attendees() []*Attendee

func (*ComponentBase) GetAllDayStartAt added in v0.2.4

func (cb *ComponentBase) GetAllDayStartAt() (time.Time, error)

func (*ComponentBase) GetDtStampTime added in v0.2.4

func (cb *ComponentBase) GetDtStampTime() (time.Time, error)

func (*ComponentBase) GetEndAt added in v0.3.2

func (cb *ComponentBase) GetEndAt() (time.Time, error)

func (*ComponentBase) GetExDates added in v0.3.5

func (cb *ComponentBase) GetExDates() ([]time.Time, error)

GetExDates returns all EXDATE times, handling both comma-separated values within a single property and multiple EXDATE properties.

func (*ComponentBase) GetExRules added in v0.3.5

func (cb *ComponentBase) GetExRules() ([]*RecurrenceRule, error)

GetExRules returns all EXRULE properties parsed into RecurrenceRule structs.

func (*ComponentBase) GetLastModifiedAt added in v0.2.4

func (cb *ComponentBase) GetLastModifiedAt() (time.Time, error)

func (*ComponentBase) GetProperties added in v0.3.2

func (cb *ComponentBase) GetProperties(componentProperty ComponentProperty) []*IANAProperty

GetProperties returns all matches for the particular property you're after. Please consider using: ComponentProperty.Singular/ComponentProperty.Multiple to determine if GetProperty or GetProperties is more appropriate.

func (*ComponentBase) GetProperty

func (cb *ComponentBase) GetProperty(componentProperty ComponentProperty) *IANAProperty

GetProperty returns the first match for the particular property you're after. Please consider using: ComponentProperty.Required to determine if GetProperty or GetProperties is more appropriate.

func (*ComponentBase) GetRDates added in v0.3.5

func (cb *ComponentBase) GetRDates() ([]time.Time, error)

GetRDates returns all RDATE times, handling both comma-separated values within a single property and multiple RDATE properties.

func (*ComponentBase) GetRRules added in v0.3.5

func (cb *ComponentBase) GetRRules() ([]*RecurrenceRule, error)

GetRRules returns all RRULE properties parsed into RecurrenceRule structs.

func (*ComponentBase) GetRecurrenceID added in v0.3.5

func (cb *ComponentBase) GetRecurrenceID() (time.Time, error)

GetRecurrenceID returns the RECURRENCE-ID property as a time.Time.

func (*ComponentBase) GetStartAt added in v0.2.4

func (cb *ComponentBase) GetStartAt() (time.Time, error)

func (*ComponentBase) HasProperty added in v0.3.2

func (cb *ComponentBase) HasProperty(componentProperty ComponentProperty) bool

HasProperty returns true if a component property is in the component.

func (*ComponentBase) Id added in v0.2.4

func (cb *ComponentBase) Id() string

func (*ComponentBase) RemoveProperty added in v0.3.2

func (cb *ComponentBase) RemoveProperty(removeProp ComponentProperty) []IANAProperty

RemoveProperty removes from the component all properties that is of a particular property type, returning an slice of removed entities

func (*ComponentBase) RemovePropertyByFunc added in v0.3.2

func (cb *ComponentBase) RemovePropertyByFunc(removeProp ComponentProperty, remove func(p IANAProperty) bool) []IANAProperty

RemovePropertyByFunc removes from the component all properties that has a particular property type and the function remove returns true for

func (*ComponentBase) RemovePropertyByValue added in v0.3.2

func (cb *ComponentBase) RemovePropertyByValue(removeProp ComponentProperty, value string) []IANAProperty

RemovePropertyByValue removes from the component all properties that has a particular property type and value, return a count of removed properties

func (*ComponentBase) ReplaceProperty added in v0.3.2

func (cb *ComponentBase) ReplaceProperty(property ComponentProperty, value string, params ...PropertyParameter) []IANAProperty

ReplaceProperty replaces all matches of the particular property you're setting, otherwise adds it. Returns a slice of removed properties. Please consider using: ComponentProperty.Singular/ComponentProperty.Multiple to determine if AddProperty, SetProperty or ReplaceProperty is more appropriate.

func (*ComponentBase) SetAllDayEndAt added in v0.2.4

func (cb *ComponentBase) SetAllDayEndAt(t time.Time, params ...PropertyParameter)

func (*ComponentBase) SetAllDayStartAt added in v0.2.4

func (cb *ComponentBase) SetAllDayStartAt(t time.Time, params ...PropertyParameter)

func (*ComponentBase) SetClass added in v0.2.4

func (cb *ComponentBase) SetClass(c Classification, params ...PropertyParameter)

func (*ComponentBase) SetColor added in v0.2.4

func (cb *ComponentBase) SetColor(s string, params ...PropertyParameter)

func (*ComponentBase) SetCreatedTime added in v0.2.4

func (cb *ComponentBase) SetCreatedTime(t time.Time, params ...PropertyParameter)

func (*ComponentBase) SetDescription added in v0.2.4

func (cb *ComponentBase) SetDescription(s string, params ...PropertyParameter)

func (*ComponentBase) SetDtStampTime added in v0.2.4

func (cb *ComponentBase) SetDtStampTime(t time.Time, params ...PropertyParameter)

func (*ComponentBase) SetDuration added in v0.3.2

func (cb *ComponentBase) SetDuration(d time.Duration) error

SetDuration updates the duration of an event. This function will set either the end or start time of an event depending what is already given. The duration defines the length of a event relative to start or end time.

Notice: It will not set the DURATION key of the ics - only DTSTART and DTEND will be affected.

func (*ComponentBase) SetEndAt added in v0.3.2

func (cb *ComponentBase) SetEndAt(t time.Time, params ...PropertyParameter)

func (*ComponentBase) SetLocation added in v0.2.4

func (cb *ComponentBase) SetLocation(s string, params ...PropertyParameter)

func (*ComponentBase) SetModifiedAt added in v0.2.4

func (cb *ComponentBase) SetModifiedAt(t time.Time, params ...PropertyParameter)

func (*ComponentBase) SetOrganizer added in v0.2.4

func (cb *ComponentBase) SetOrganizer(s string, params ...PropertyParameter)

func (*ComponentBase) SetProperty

func (cb *ComponentBase) SetProperty(property ComponentProperty, value string, params ...PropertyParameter)

SetProperty replaces the first match for the particular property you're setting, otherwise adds it. Please consider using: ComponentProperty.Singular/ComponentProperty.Multiple to determine if AddProperty, SetProperty or ReplaceProperty is more appropriate.

func (*ComponentBase) SetSequence added in v0.2.4

func (cb *ComponentBase) SetSequence(seq int, params ...PropertyParameter)

func (*ComponentBase) SetStartAt added in v0.2.4

func (cb *ComponentBase) SetStartAt(t time.Time, params ...PropertyParameter)

func (*ComponentBase) SetStatus added in v0.2.4

func (cb *ComponentBase) SetStatus(s ObjectStatus, params ...PropertyParameter)

func (*ComponentBase) SetSummary added in v0.2.4

func (cb *ComponentBase) SetSummary(s string, params ...PropertyParameter)

func (*ComponentBase) SetURL added in v0.2.4

func (cb *ComponentBase) SetURL(s string, params ...PropertyParameter)

func (*ComponentBase) SubComponents

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

func (*ComponentBase) UnknownPropertiesIANAProperties

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

type ComponentProperty

type ComponentProperty Property

func ComponentPropertyExtended added in v0.3.2

func ComponentPropertyExtended(s string) ComponentProperty

func (ComponentProperty) Exclusive added in v0.3.2

func (cp ComponentProperty) Exclusive(c Component) []ComponentProperty

Exclusive returns the ComponentProperty's using the rules from the RFC as to if one or more existing properties are prohibiting this one If unspecified or incomplete, it returns false. -- This list is incomplete verify source. Happy to take PRs with reference iana-prop and x-props are not covered as it would always be true and require an exhaustive list.

func (ComponentProperty) Multiple added in v0.3.2

func (cp ComponentProperty) Multiple(c Component) bool

Multiple returns the rules from the RFC as to if the spec states explicitly if multiple are allowed iana-prop and x-props are not covered as it would always be true and require an exhaustive list.

func (ComponentProperty) Optional added in v0.3.2

func (cp ComponentProperty) Optional(c Component) bool

Optional returns the rules from the RFC as to if the spec states that if these are optional iana-prop and x-props are not covered as it would always be true and require an exhaustive list.

func (ComponentProperty) Required added in v0.3.2

func (cp ComponentProperty) Required(c Component) bool

Required returns the rules from the RFC as to if they are required or not for any particular component type If unspecified or incomplete, it returns false. -- This list is incomplete verify source. Happy to take PRs with reference iana-prop and x-props are not covered as it would always be true and require an exhaustive list.

func (ComponentProperty) Singular added in v0.3.2

func (cp ComponentProperty) Singular(c Component) bool

Singular returns the rules from the RFC as to if the spec states that if "Must not occur more than once" iana-prop and x-props are not covered as it would always be true and require an exhaustive list.

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 ParseDaylightWithError added in v0.3.2

func ParseDaylightWithError(cs *CalendarStream, startLine *BaseProperty) (*Daylight, error)

func (*Daylight) Serialize

func (daylight *Daylight) Serialize(serialConfig *SerializationConfiguration) string

func (*Daylight) SerializeTo added in v0.3.2

func (daylight *Daylight) SerializeTo(w io.Writer, serialConfig *SerializationConfiguration) error

type FreeBusyTimeType

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

type Frequency added in v0.3.5

type Frequency string
const (
	FrequencySecondly Frequency = "SECONDLY"
	FrequencyMinutely Frequency = "MINUTELY"
	FrequencyHourly   Frequency = "HOURLY"
	FrequencyDaily    Frequency = "DAILY"
	FrequencyWeekly   Frequency = "WEEKLY"
	FrequencyMonthly  Frequency = "MONTHLY"
	FrequencyYearly   Frequency = "YEARLY"
)

type GeneralComponent

type GeneralComponent struct {
	ComponentBase
	Token string
}

func ParseGeneralComponent

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

func ParseGeneralComponentWithError added in v0.3.2

func ParseGeneralComponentWithError(cs *CalendarStream, startLine *BaseProperty) (*GeneralComponent, error)

func (*GeneralComponent) Serialize

func (general *GeneralComponent) Serialize(serialConfig *SerializationConfiguration) string

func (*GeneralComponent) SerializeTo added in v0.3.2

func (general *GeneralComponent) SerializeTo(w io.Writer, serialConfig *SerializationConfiguration) error

type GeoType added in v0.3.3

type GeoType interface {
	~float32 | ~float64 | ~int | ~int8 | ~int16 | ~int32 | ~int64 | ~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~string
}

type HttpClientLike added in v0.3.2

type HttpClientLike interface {
	Do(req *http.Request) (*http.Response, error)
}

type IANAProperty

type IANAProperty struct {
	BaseProperty
}

type KeyValues

type KeyValues struct {
	Key   string
	Value []string
}

func (*KeyValues) KeyValue

func (kv *KeyValues) KeyValue(_ ...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(_ ...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"
)

func (Parameter) IsQuoted added in v0.3.2

func (p Parameter) IsQuoted() bool

type ParseOption added in v0.3.3

type ParseOption func(*Calendar) error

ParseOption provides functional options for ParseCalendar

func WithUnknownPropertyHandler added in v0.3.3

func WithUnknownPropertyHandler(f func(*Calendar, string, *BaseProperty) error) ParseOption

WithUnknownPropertyHandler allows custom handling of unknown properties

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(_ ...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(_ ...interface{}) (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
	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"
	PropertyTimezoneId      Property = "TIMEZONE-ID"
)

type PropertyParameter

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

func WithAlternativeRepresentation added in v0.3.2

func WithAlternativeRepresentation(uri *url.URL) PropertyParameter

WithAlternativeRepresentation takes what must be a valid URI in quotation marks

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 WithTZID added in v0.3.2

func WithTZID(tzid string) PropertyParameter

func WithValue

func WithValue(kind string) PropertyParameter

type RecurrenceRule added in v0.3.5

type RecurrenceRule struct {
	Freq          Frequency
	Until         time.Time // zero value if unset
	UntilDateOnly bool      // true when UNTIL was parsed from a date-only value (no time component)
	Count         int       // 0 if unset
	Interval      int       // defaults to 1
	BySecond      []int
	ByMinute      []int
	ByHour        []int
	ByDay         []WeekdayNum
	ByMonthDay    []int
	ByYearDay     []int
	ByWeekNo      []int
	ByMonth       []int
	BySetPos      []int
	Wkst          Weekday // empty string if unset
}

RecurrenceRule represents a parsed RRULE as defined in RFC 5545 Section 3.3.10.

func ParseRecurrenceRule added in v0.3.5

func ParseRecurrenceRule(s string) (*RecurrenceRule, error)

ParseRecurrenceRule parses an RRULE value string (without the "RRULE:" prefix) into a RecurrenceRule struct.

func (*RecurrenceRule) String added in v0.3.5

func (r *RecurrenceRule) String() string

String serializes the RecurrenceRule back to RRULE value format (without "RRULE:" prefix).

type RelationshipType

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

type SerializationConfiguration added in v0.3.2

type SerializationConfiguration struct {
	MaxLength         int
	NewLine           string
	PropertyMaxLength int
}

type SetPropertyOwner added in v0.3.3

type SetPropertyOwner interface {
	SetProperty(property ComponentProperty, value string, params ...PropertyParameter)
}

type Standard

type Standard struct {
	ComponentBase
}

func NewStandard added in v0.3.2

func NewStandard() *Standard

func ParseStandard

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

func ParseStandardWithError added in v0.3.2

func ParseStandardWithError(cs *CalendarStream, startLine *BaseProperty) (*Standard, error)

func (*Standard) Serialize

func (standard *Standard) Serialize(serialConfig *SerializationConfiguration) string

func (*Standard) SerializeTo added in v0.3.2

func (standard *Standard) SerializeTo(w io.Writer, serialConfig *SerializationConfiguration) error

type TimeTransparency

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

type VAlarm

type VAlarm struct {
	ComponentBase
}

func NewAlarm added in v0.2.4

func NewAlarm(tzId string) *VAlarm

func ParseVAlarm

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

func ParseVAlarmWithError added in v0.3.2

func ParseVAlarmWithError(cs *CalendarStream, startLine *BaseProperty) (*VAlarm, error)

func (*VAlarm) Serialize

func (c *VAlarm) Serialize(serialConfig *SerializationConfiguration) string

func (*VAlarm) SerializeTo added in v0.3.2

func (c *VAlarm) SerializeTo(w io.Writer, serialConfig *SerializationConfiguration) error

func (*VAlarm) SetAction

func (c *VAlarm) SetAction(a Action, params ...PropertyParameter)

func (*VAlarm) SetTrigger

func (c *VAlarm) SetTrigger(s string, params ...PropertyParameter)

type VBusy

type VBusy struct {
	ComponentBase
}

func NewBusy added in v0.2.4

func NewBusy(uniqueId string) *VBusy

func ParseVBusy

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

func ParseVBusyWithError added in v0.3.2

func ParseVBusyWithError(cs *CalendarStream, startLine *BaseProperty) (*VBusy, error)

func (*VBusy) Serialize

func (busy *VBusy) Serialize(serialConfig *SerializationConfiguration) string

func (*VBusy) SerializeTo added in v0.3.2

func (busy *VBusy) SerializeTo(w io.Writer, serialConfig *SerializationConfiguration) error

type VEvent

type VEvent struct {
	ComponentBase
}

func NewEvent

func NewEvent(uniqueId string) *VEvent

func ParseVEvent

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

func ParseVEventWithError added in v0.3.2

func ParseVEventWithError(cs *CalendarStream, startLine *BaseProperty) (*VEvent, error)

func (*VEvent) AddAlarm

func (event *VEvent) AddAlarm() *VAlarm

func (*VEvent) AddVAlarm added in v0.2.4

func (event *VEvent) AddVAlarm(a *VAlarm)

func (*VEvent) Alarms

func (event *VEvent) Alarms() []*VAlarm

func (*VEvent) GetAllDayEndAt

func (event *VEvent) GetAllDayEndAt() (time.Time, error)

func (*VEvent) Serialize

func (event *VEvent) Serialize(serialConfig *SerializationConfiguration) string

func (*VEvent) SerializeTo added in v0.3.2

func (event *VEvent) SerializeTo(w io.Writer, serialConfig *SerializationConfiguration) error

func (*VEvent) SetEndAt

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

func (*VEvent) SetGeo

func (event *VEvent) SetGeo(lat interface{}, lng interface{}, params ...PropertyParameter)

SetGeo sets the geo property

func (*VEvent) SetLastModifiedAt added in v0.2.3

func (event *VEvent) SetLastModifiedAt(t time.Time, props ...PropertyParameter)

func (*VEvent) SetPriority added in v0.2.4

func (event *VEvent) SetPriority(p int, params ...PropertyParameter)

func (*VEvent) SetResources added in v0.2.4

func (event *VEvent) SetResources(r string, params ...PropertyParameter)

func (*VEvent) SetTimeTransparency

func (event *VEvent) SetTimeTransparency(v TimeTransparency, params ...PropertyParameter)

type VJournal

type VJournal struct {
	ComponentBase
}

func NewJournal added in v0.2.4

func NewJournal(uniqueId string) *VJournal

func ParseVJournal

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

func ParseVJournalWithError added in v0.3.2

func ParseVJournalWithError(cs *CalendarStream, startLine *BaseProperty) (*VJournal, error)

func (*VJournal) Serialize

func (journal *VJournal) Serialize(serialConfig *SerializationConfiguration) string

func (*VJournal) SerializeTo added in v0.3.2

func (journal *VJournal) SerializeTo(w io.Writer, serialConfig *SerializationConfiguration) error

type VTimezone

type VTimezone struct {
	ComponentBase
}

func NewTimezone added in v0.2.4

func NewTimezone(tzId string) *VTimezone

func ParseVTimezone

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

func ParseVTimezoneWithError added in v0.3.2

func ParseVTimezoneWithError(cs *CalendarStream, startLine *BaseProperty) (*VTimezone, error)

func (*VTimezone) AddStandard added in v0.3.2

func (timezone *VTimezone) AddStandard() *Standard

func (*VTimezone) Serialize

func (timezone *VTimezone) Serialize(serialConfig *SerializationConfiguration) string

func (*VTimezone) SerializeTo added in v0.3.2

func (timezone *VTimezone) SerializeTo(w io.Writer, serialConfig *SerializationConfiguration) error

type VTodo

type VTodo struct {
	ComponentBase
}

func NewTodo added in v0.2.4

func NewTodo(uniqueId string) *VTodo

func ParseVTodo

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

func ParseVTodoWithError added in v0.3.2

func ParseVTodoWithError(cs *CalendarStream, startLine *BaseProperty) (*VTodo, error)

func (*VTodo) AddAlarm added in v0.2.4

func (todo *VTodo) AddAlarm() *VAlarm

func (*VTodo) AddVAlarm added in v0.2.4

func (todo *VTodo) AddVAlarm(a *VAlarm)

func (*VTodo) Alarms added in v0.2.4

func (todo *VTodo) Alarms() []*VAlarm

func (*VTodo) GetAllDayDueAt added in v0.2.4

func (todo *VTodo) GetAllDayDueAt() (time.Time, error)

func (*VTodo) GetDueAt added in v0.2.4

func (todo *VTodo) GetDueAt() (time.Time, error)

func (*VTodo) Serialize

func (todo *VTodo) Serialize(serialConfig *SerializationConfiguration) string

func (*VTodo) SerializeTo added in v0.3.2

func (todo *VTodo) SerializeTo(w io.Writer, serialConfig *SerializationConfiguration) error

func (*VTodo) SetAllDayCompletedAt added in v0.2.4

func (todo *VTodo) SetAllDayCompletedAt(t time.Time, params ...PropertyParameter)

func (*VTodo) SetAllDayDueAt added in v0.2.4

func (todo *VTodo) SetAllDayDueAt(t time.Time, params ...PropertyParameter)

func (*VTodo) SetCompletedAt added in v0.2.4

func (todo *VTodo) SetCompletedAt(t time.Time, params ...PropertyParameter)

func (*VTodo) SetDueAt added in v0.2.4

func (todo *VTodo) SetDueAt(t time.Time, params ...PropertyParameter)

func (*VTodo) SetDuration added in v0.2.4

func (todo *VTodo) SetDuration(d time.Duration) error

SetDuration updates the duration of an event. This function will set either the end or start time of an event depending what is already given. The duration defines the length of a event relative to start or end time.

Notice: It will not set the DURATION key of the ics - only DTSTART and DTEND will be affected.

func (*VTodo) SetGeo added in v0.2.4

func (todo *VTodo) SetGeo(lat interface{}, lng interface{}, params ...PropertyParameter)

SetGeo sets the geo property

func (*VTodo) SetPercentComplete added in v0.2.4

func (todo *VTodo) SetPercentComplete(p int, params ...PropertyParameter)

func (*VTodo) SetPriority added in v0.2.4

func (todo *VTodo) SetPriority(p int, params ...PropertyParameter)

func (*VTodo) SetResources added in v0.2.4

func (todo *VTodo) SetResources(r string, params ...PropertyParameter)

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"
)

type Weekday added in v0.3.5

type Weekday string
const (
	WeekdaySunday    Weekday = "SU"
	WeekdayMonday    Weekday = "MO"
	WeekdayTuesday   Weekday = "TU"
	WeekdayWednesday Weekday = "WE"
	WeekdayThursday  Weekday = "TH"
	WeekdayFriday    Weekday = "FR"
	WeekdaySaturday  Weekday = "SA"
)

type WeekdayNum added in v0.3.5

type WeekdayNum struct {
	OrdWeek int
	Day     Weekday
}

WeekdayNum represents a weekday with an optional ordinal (e.g., -1SU = last Sunday, 2MO = second Monday). OrdWeek of 0 means no ordinal was specified.

func (WeekdayNum) String added in v0.3.5

func (wdn WeekdayNum) String() string

type WithLineLength added in v0.3.2

type WithLineLength int

type WithNewLine added in v0.3.2

type WithNewLine string
const (
	WithNewLineUnix    WithNewLine = "\n"
	WithNewLineWindows WithNewLine = "\r\n"
)

Directories

Path Synopsis
cmd
issues/test97_1 command

Jump to

Keyboard shortcuts

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