value

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2018 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MINUTELY = "MINUTELY"
	HOURLY   = "HOURLY"
	DAILY    = "DAILY"
	WEEKLY   = "WEEKLY"
	MONTHLY  = "MONTHLY"
	YEARLY   = "YEARLY"
)

Variables

View Source
var FR = WeekDayNum{WeekDay: Friday}
View Source
var MO = WeekDayNum{WeekDay: Monday}
View Source
var SA = WeekDayNum{WeekDay: Saturday}
View Source
var SU = WeekDayNum{WeekDay: Sunday}
View Source
var TH = WeekDayNum{WeekDay: Thursday}
View Source
var TU = WeekDayNum{WeekDay: Tuesday}
View Source
var WE = WeekDayNum{WeekDay: Wednesday}

Functions

This section is empty.

Types

type Attachable

type Attachable interface {
	ics.Valuer
	IsAttachable()
}

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 Binary

func Binary(data []byte) BinaryValue

Binary returns a new BinaryValue.

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 Class

func Class(v string) ClassValue

Class constructs a new classification value.

func Confidential

func Confidential() ClassValue

Confidential is a confidential event.

func Private

func Private() ClassValue

Private is a private event.

func Public

func Public() ClassValue

Public is an event visible publicly.

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

func Geo(lat, lon float64) GeoValue

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.

See https://tools.ietf.org/html/rfc5545#section-3.8.1.6

func (GeoValue) IsDefined

func (v GeoValue) IsDefined() bool

IsDefined tests whether the value has been explicitly defined or is default.

func (GeoValue) With

func (v GeoValue) With(params ...parameter.Parameter) GeoValue

With appends parameters to the value.

func (GeoValue) WriteTo

func (v GeoValue) WriteTo(w ics.StringWriter) error

WriteTo writes the value to the writer. This is part of the Valuer interface.

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

func List(v ...string) ListValue

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 Method

func Method(v string) MethodValue

Method constructs a new transparency value.

func Publish

func Publish() MethodValue

Publish specifies a publish event.

func Request

func Request() MethodValue

Request specifies an event that is a request to attend.

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

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 Status

func Status(v string) StatusValue

Status constructs a new status value.

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 Temporal

type Temporal interface {
	ics.Valuer
	IsTemporal()
}

Temporal marks values that are date-time or period.

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 Text

func Text(v string) TextValue

Text constructs a new text value.

func (TextValue) IsDefined

func (v TextValue) IsDefined() bool

IsDefined tests whether the value has been explicitly defined or is default.

func (TextValue) With

func (v TextValue) With(params ...parameter.Parameter) TextValue

With appends parameters to the value.

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

type Trigger interface {
	ics.Valuer
	IsTrigger()
}

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 CalAddress

func CalAddress(mailto string) URIValue

CalAddress returns a new CalAddressValue.

func URI

func URI(uri string) URIValue

URI returns a new URIValue.

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

func (v URIValue) With(params ...parameter.Parameter) URIValue

With appends parameters to the value.

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

type WeekDayNum struct {
	OrdWk   int
	WeekDay Weekday
}

func (WeekDayNum) InRange

func (wdn WeekDayNum) InRange() bool

func (WeekDayNum) String

func (wdn WeekDayNum) String() string

type Weekday

type Weekday time.Weekday
const (
	Undefined Weekday = iota
	Sunday
	Monday
	Tuesday
	Wednesday
	Thursday
	Friday
	Saturday
)

func (Weekday) String

func (d Weekday) String() string

String returns abbreviated English name of the day ("SU", "MO", ...).

Jump to

Keyboard shortcuts

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