Documentation
¶
Index ¶
- Constants
- Variables
- type Attachable
- type BinaryValue
- type DateTimeValue
- type DurationValue
- type GeoValue
- type IntegerValue
- type ListValue
- type PeriodValue
- type RecurrenceValue
- type Temporal
- type TextValue
- func Cancelled() TextValue
- func Completed() TextValue
- func Confidential() TextValue
- func Confirmed() TextValue
- func Draft() TextValue
- func Final() TextValue
- func InProcess() TextValue
- func NeedsAction() TextValue
- func Opaque() TextValue
- func Private() TextValue
- func Public() TextValue
- func Publish() TextValue
- func Request() TextValue
- func Tentative() TextValue
- func Text(v string) TextValue
- func Texts(vv ...string) []TextValue
- func Transparent() TextValue
- type Trigger
- type URIValue
- type WeekDayNum
- type Weekday
Constants ¶
const ( MINUTELY = "MINUTELY" HOURLY = "HOURLY" DAILY = "DAILY" WEEKLY = "WEEKLY" MONTHLY = "MONTHLY" YEARLY = "YEARLY" )
Variables ¶
var FR = WeekDayNum{WeekDay: Friday}
var MO = WeekDayNum{WeekDay: Monday}
var SA = WeekDayNum{WeekDay: Saturday}
var SU = WeekDayNum{WeekDay: Sunday}
var TH = WeekDayNum{WeekDay: Thursday}
var TU = WeekDayNum{WeekDay: Tuesday}
var WE = WeekDayNum{WeekDay: Wednesday}
Functions ¶
This section is empty.
Types ¶
type Attachable ¶
Attachable marks values that are attachable.
func Attachables ¶ added in v0.8.0
func Attachables(vv ...Attachable) []Attachable
Attachables is a short-hand for composing URIValues and Binary values as a list.
type BinaryValue ¶
type BinaryValue struct {
Parameters parameter.Parameters
Value []byte
}
BinaryValue holds binary data, such as an inline image.
func (BinaryValue) IsAttachable ¶
func (v BinaryValue) IsAttachable()
IsAttachable indicates that binary values can be used as images or attachments.
func (BinaryValue) IsDefined ¶
func (v BinaryValue) IsDefined() bool
IsDefined tests whether the value has been explicitly defined or is default.
func (BinaryValue) With ¶
func (v BinaryValue) With(params ...parameter.Parameter) BinaryValue
With appends parameters to the value.
func (BinaryValue) WriteTo ¶
func (v BinaryValue) WriteTo(w ics.StringWriter) error
WriteTo writes the value to the writer. This is part of the Writable interface.
type DateTimeValue ¶
type DateTimeValue struct {
Parameters parameter.Parameters
Value time.Time
Others []time.Time
// contains filtered or unexported fields
}
DateTimeValue holds a date/time and its formatting decision. See https://tools.ietf.org/html/rfc5545#section-3.3.5
func Date ¶
func Date(t time.Time, others ...time.Time) DateTimeValue
Date constructs a new date value, i.e. without time.
If more than one time value is provided, they are represented as a comma-separated list.
The property has VALUE=DATE-TIME.
func DateTime ¶
func DateTime(t time.Time, others ...time.Time) DateTimeValue
DateTime constructs a new date-time value. If the time parameter(s) is UTC, it is represented using the Zulu "Z" suffix. Otherwise, it is represented as a "floating" local time; however the TZID parameter can be used to steer this.
If more than one time value is provided, they are represented as a comma-separated list.
The property has VALUE=DATE-TIME.
func TStamp ¶
func TStamp(t time.Time) DateTimeValue
TStamp constructs a date-time value using UTC. It has no VALUE parameter; the type is the default and is obvious from the rendered value.
func (DateTimeValue) AsDate ¶
func (v DateTimeValue) AsDate() DateTimeValue
AsDate converts a date-time value to a date-only value.
func (DateTimeValue) IsDefined ¶
func (v DateTimeValue) IsDefined() bool
IsDefined tests whether the value has been explicitly defined or is default.
func (DateTimeValue) IsTemporal ¶
func (v DateTimeValue) IsTemporal()
IsTemporal allows date-time to be used for temporal use-cases.
func (DateTimeValue) IsTrigger ¶
func (v DateTimeValue) IsTrigger()
IsTrigger allows date-time to be used for triggers.
func (DateTimeValue) With ¶
func (v DateTimeValue) With(params ...parameter.Parameter) DateTimeValue
With appends parameters to the value.
func (DateTimeValue) WriteTo ¶
func (v DateTimeValue) WriteTo(w ics.StringWriter) (err error)
WriteTo writes the value to the writer. This is part of the Valuer interface.
type DurationValue ¶
type DurationValue struct {
// contains filtered or unexported fields
}
DurationValue holds a time duration. This should be in ISO-8601 form (https://en.wikipedia.org/wiki/ISO_8601#Durations); see github.com/rickb777/date/period for a compatible duration API.
func Duration ¶
func Duration(d string) DurationValue
Duration returns a new DurationValue. It has VALUE=DURATION.
func (DurationValue) IsDefined ¶
func (v DurationValue) IsDefined() bool
IsDefined tests whether the value has been explicitly defined or is default.
func (DurationValue) IsTrigger ¶
func (v DurationValue) IsTrigger()
IsTrigger allows duration to be used for triggers.
func (DurationValue) With ¶
func (v DurationValue) With(params ...parameter.Parameter) DurationValue
With appends parameters to the value.
func (DurationValue) WriteTo ¶
func (v DurationValue) WriteTo(w ics.StringWriter) error
WriteTo writes the value to the writer. This is part of the Valuer interface.
type GeoValue ¶
type GeoValue struct {
Parameters parameter.Parameters
Lat, Lon float64
// contains filtered or unexported fields
}
GeoValue holds an integer.
func Geo ¶
Geo returns a new GeoValue. Values for latitude and longitude are expressed as decimal fractions of degrees. Whole degrees of latitude are represented by a decimal number ranging from 0 through 90. Whole degrees of longitude are represented by a decimal number ranging from 0 through 180. Each can be positive or negative.
It has VALUE=FLOAT.
func (GeoValue) IsDefined ¶
IsDefined tests whether the value has been explicitly defined or is default.
type IntegerValue ¶
type IntegerValue struct {
Parameters parameter.Parameters
Value int
// contains filtered or unexported fields
}
IntegerValue holds an integer.
func Integer ¶
func Integer(number int) IntegerValue
Integer returns a new IntegerValue. It has VALUE=INTEGER.
func (IntegerValue) IsDefined ¶
func (v IntegerValue) IsDefined() bool
IsDefined tests whether the value has been explicitly defined or is default.
func (IntegerValue) With ¶
func (v IntegerValue) With(params ...parameter.Parameter) IntegerValue
With appends parameters to the value.
func (IntegerValue) WriteTo ¶
func (v IntegerValue) WriteTo(w ics.StringWriter) error
WriteTo writes the value to the writer. This is part of the Valuer interface.
type ListValue ¶
type ListValue struct {
// contains filtered or unexported fields
}
ListValue holds a list of one or more text values.
func List ¶
List constructs a new list value.
Recommended categories values include "ANNIVERSARY", "APPOINTMENT", "BUSINESS", "EDUCATION", "HOLIDAY", "MEETING", "MISCELLANEOUS", "NON-WORKING HOURS", "NOT IN OFFICE", "PERSONAL", "PHONE CALL", "SICK DAY", "SPECIAL OCCASION", "TRAVEL", "VACATION".
Recommended resources values include "CATERING", "CHAIRS", "COMPUTER PROJECTOR", "EASEL", "OVERHEAD PROJECTOR", "SPEAKER PHONE", "TABLE", "TV", "VCR", "VIDEO PHONE", "VEHICLE".
func Lists ¶ added in v0.8.0
Lists constructs one or more list values, grouping the strings provided so that they span across multiple lines rather than using the line folding algorithm.
func (ListValue) IsDefined ¶
func (v ListValue) IsDefined() bool
IsDefined tests whether the value has been explicitly defined or is default.
func (ListValue) WriteTo ¶
func (v ListValue) WriteTo(w ics.StringWriter) (err error)
WriteTo writes the value to the writer. This is part of the Valuer interface.
type PeriodValue ¶
type PeriodValue struct {
Parameters parameter.Parameters
Value timespan.TimeSpan
}
PeriodValue holds a date/time and its formatting decision. See https://tools.ietf.org/html/rfc5545#section-3.3.5
func Period ¶
func Period(ts timespan.TimeSpan) PeriodValue
Period constructs a new timespan value. The time should be UTC. It has VALUE=PERIOD.
func PeriodOf ¶
func PeriodOf(t time.Time, d time.Duration) PeriodValue
PeriodOf constructs a new timespan value. The time should be UTC. It has VALUE=PERIOD.
func (PeriodValue) IsDefined ¶
func (v PeriodValue) IsDefined() bool
IsDefined tests whether the value has been explicitly defined or is default.
func (PeriodValue) IsTemporal ¶
func (v PeriodValue) IsTemporal()
IsTemporal allows period to be used for temporal use-cases.
func (PeriodValue) With ¶
func (v PeriodValue) With(params ...parameter.Parameter) PeriodValue
With appends parameters to the value.
func (PeriodValue) WriteTo ¶
func (v PeriodValue) WriteTo(w ics.StringWriter) error
WriteTo writes the value to the writer. This is part of the Valuer interface.
type RecurrenceValue ¶
type RecurrenceValue struct {
Parameters parameter.Parameters
Freq string
Interval uint
Count uint
Until time.Time
ByWeekNo []int
ByMonth []uint
ByHour []uint
ByMinute []uint
BySecond []uint
ByDay []WeekDayNum
ByMonthDay []int
ByYearDay []int
BySetPos []int
WeekStart Weekday
}
RecurrenceValue holds an integer.
func Recurrence ¶
func Recurrence(freq string) RecurrenceValue
Recurrence returns a new RecurrenceValue. It has VALUE=INTEGER.
func (RecurrenceValue) IsDefined ¶
func (v RecurrenceValue) IsDefined() bool
IsDefined tests whether the value has been explicitly defined or is default.
func (RecurrenceValue) Validate ¶
func (v RecurrenceValue) Validate() (err error)
Validate confirms that the recurrence parameters are within valid ranges.
func (RecurrenceValue) With ¶
func (v RecurrenceValue) With(params ...parameter.Parameter) RecurrenceValue
With appends parameters to the value.
func (RecurrenceValue) WriteTo ¶
func (v RecurrenceValue) WriteTo(w ics.StringWriter) (err error)
WriteTo writes the value to the writer. This is part of the Valuer interface.
type TextValue ¶
type TextValue struct {
// contains filtered or unexported fields
}
TextValue holds a value that is a string and which will be escaped when written out.
func Cancelled ¶ added in v0.8.0
func Cancelled() TextValue
Cancelled specifies an event, a to-do or a journal with cancelled status. Use this for the Status.
func Completed ¶ added in v0.8.0
func Completed() TextValue
Completed specifies a to-do with COMPLETED status. Use this for the Status.
func Confidential ¶
func Confidential() TextValue
Confidential is a CONFIDENTIAL event. Use this for the Class.
func Confirmed ¶ added in v0.8.0
func Confirmed() TextValue
Confirmed specifies an event with confirmed status. Use this for the Status.
func Draft ¶ added in v0.8.0
func Draft() TextValue
Draft specifies a journal with DRAFT status. Use this for the Status.
func Final ¶ added in v0.8.0
func Final() TextValue
Final specifies a journal with FINAL status. Use this for the Status.
func InProcess ¶ added in v0.8.0
func InProcess() TextValue
InProcess specifies a to-do with IN-PROCESS status. Use this for the Status.
func NeedsAction ¶ added in v0.8.0
func NeedsAction() TextValue
NeedsAction specifies a to-do with NEEDS-ACTION status. Use this for the Status.
func Opaque ¶
func Opaque() TextValue
Opaque specifies event is OPAQUE, i.e. when the event blocks other events.
func Request ¶
func Request() TextValue
Request specifies an event that is a REQUEST to attend. Use this for the Method.
func Tentative ¶ added in v0.8.0
func Tentative() TextValue
Tentative specifies an event with TENTATIVE status. Use this for the Status.
func Texts ¶ added in v0.8.0
Texts constructs a new []TextValue slice. These will be rendered on separate lines.
func Transparent ¶
func Transparent() TextValue
Transparent specifies event is TRANSPARENT, i.e. when the event does not block other events.
func (TextValue) IsDefined ¶
func (v TextValue) IsDefined() bool
IsDefined tests whether the value has been explicitly defined or is default.
func (TextValue) WriteTo ¶
func (v TextValue) WriteTo(w ics.StringWriter) (err error)
WriteTo writes the value to the writer. This is part of the Valuer interface.
type Trigger ¶
Trigger marks values that can be used as alarm triggers: date-time or duration before/after the event start.
type URIValue ¶
type URIValue struct {
// contains filtered or unexported fields
}
URIValue holds a URI.
func URIs ¶ added in v0.8.0
URIs constructs a new []URIValue slice. These will be rendered on separate lines.
func (URIValue) IsAttachable ¶
func (v URIValue) IsAttachable()
IsAttachable indicates that URI values can be used as images or attachments.
func (URIValue) IsDefined ¶
func (v URIValue) IsDefined() bool
IsDefined tests whether the value has been explicitly defined or is default.
func (URIValue) WriteTo ¶
func (v URIValue) WriteTo(w ics.StringWriter) (err error)
WriteTo writes the value to the writer. This is part of the Valuer interface.
type WeekDayNum ¶
func (WeekDayNum) InRange ¶
func (wdn WeekDayNum) InRange() bool
func (WeekDayNum) String ¶
func (wdn WeekDayNum) String() string