Documentation
¶
Index ¶
- Constants
- Variables
- type Attachable
- type BinaryValue
- type ClassValue
- type DateTimeValue
- type DurationValue
- type GeoValue
- type IntegerValue
- type ListValue
- type MethodValue
- type PeriodValue
- type RecurrenceValue
- type StatusValue
- func CancelledStatus() StatusValue
- func CompletedStatus() StatusValue
- func ConfirmedStatus() StatusValue
- func DraftStatus() StatusValue
- func FinalStatus() StatusValue
- func InProcessStatus() StatusValue
- func NeedsActionStatus() StatusValue
- func Status(v string) StatusValue
- func TentativeStatus() StatusValue
- type Temporal
- type TextValue
- type TransparencyValue
- 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.
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 ClassValue ¶
type ClassValue struct {
TextValue
}
ClassValue holds a classification value.
func (ClassValue) IsDefined ¶
func (v ClassValue) IsDefined() bool
IsDefined tests whether the value has been explicitly defined or is default.
func (ClassValue) WriteTo ¶
func (v ClassValue) WriteTo(w ics.StringWriter) (err error)
WriteTo writes the value to the writer. This is part of the Valuer 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 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 (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 MethodValue ¶
type MethodValue struct {
TextValue
}
MethodValue holds a transparency value.
func (MethodValue) IsDefined ¶
func (v MethodValue) IsDefined() bool
IsDefined tests whether the value has been explicitly defined or is default.
func (MethodValue) WriteTo ¶
func (v MethodValue) 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 StatusValue ¶
type StatusValue struct {
TextValue
}
StatusValue holds a status value.
func CancelledStatus ¶
func CancelledStatus() StatusValue
CancelledStatus specifies an event, a to-do or a journal with cancelled status.
func CompletedStatus ¶
func CompletedStatus() StatusValue
CompletedStatus specifies a to-do with completed status.
func ConfirmedStatus ¶
func ConfirmedStatus() StatusValue
ConfirmedStatus specifies an event with confirmed status.
func DraftStatus ¶
func DraftStatus() StatusValue
DraftStatus specifies a journal with draft status.
func FinalStatus ¶
func FinalStatus() StatusValue
FinalStatus specifies a journal with final status.
func InProcessStatus ¶
func InProcessStatus() StatusValue
InProcessStatus specifies a to-do with in-process status.
func NeedsActionStatus ¶
func NeedsActionStatus() StatusValue
NeedsActionStatus specifies a to-do with needs-action status.
func TentativeStatus ¶
func TentativeStatus() StatusValue
TentativeStatus specifies an event with tentative status.
func (StatusValue) IsDefined ¶
func (v StatusValue) IsDefined() bool
IsDefined tests whether the value has been explicitly defined or is default.
func (StatusValue) WriteTo ¶
func (v StatusValue) 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 (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 TransparencyValue ¶
type TransparencyValue struct {
TextValue
}
TransparencyValue holds a transparency value.
func Opaque ¶
func Opaque() TransparencyValue
Opaque specifies event transparency when the event blocks other events.
func Transparency ¶
func Transparency(v string) TransparencyValue
Transparency constructs a new transparency value.
func Transparent ¶
func Transparent() TransparencyValue
Transparent specifies event transparency when the event does not block other events.
func (TransparencyValue) IsDefined ¶
func (v TransparencyValue) IsDefined() bool
IsDefined tests whether the value has been explicitly defined or is default.
func (TransparencyValue) WriteTo ¶
func (v TransparencyValue) 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 (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