parameter

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: 3 Imported by: 0

Documentation

Overview

Package parameter handles iCalendar parameters. The key is required to be case-insensitive. Here, this this generally implemented by using upper-case keys, a pattern that must be carefully followed if Parameter structs are created on the fly.

All the factory functions in this package that return a Parameter will use an upper-case key.

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

Index

Constants

View Source
const ALTREP = "ALTREP"

ALTREP is the key for an alternate text representation parameter.

View Source
const CN = "CN"

CN is the key for a common name parameter.

View Source
const DELEGATED_FROM = "DELEGATED-FROM"

DELEGATED_FROM is the key for a delegator parameter.

View Source
const DELEGATED_TO = "DELEGATED-TO"

DELEGATED_TO is the key for a delegatee parameter.

View Source
const DIR = "DIR"

DIR is the key for a directory parameter.

View Source
const EMAIL = "EMAIL"

EMAIL is the key for an email parameter.

View Source
const ENCODING = "ENCODING"

ENCODING is the key for an encoding parameter.

View Source
const FMTTYPE = "FMTTYPE"

FMTYPE is the key for a media type parameter.

View Source
const LABEL = "LABEL"

LABEL is the key for a label parameter.

View Source
const LANGUAGE = "LANGUAGE"

LANGUAGE is the key for a language parameter.

View Source
const MEMBER = "MEMBER"

MEMBER is the key for a member parameter.

View Source
const RSVP = "RSVP"

RSVP is the key for a RSVP parameter.

View Source
const SENT_BY = "SENT-BY"

SENT_BY is the key for a sent-by parameter.

View Source
const TZID = "TZID"

TZID is the key for a timezone ID parameter.

Variables

This section is empty.

Functions

This section is empty.

Types

type Parameter

type Parameter struct {
	Key    string
	Value  string   // there is always at least one value
	Others []string // there may be others too
}

Parameter holds an iCalendar parameter. The key must be uppercase, this being a pattern that simplifies the requirement for keys to be case-insensitive.

For most parameters, the value is singular, i.e. there is exactly one string. There are a few exceptions that have several values, expressed as a comma-separated list.

func AltRep

func AltRep(v string) Parameter

AltRep specifies an alternate text representation for the property value.

func CommonName

func CommonName(v string) Parameter

CommonName specifies the common name to be associated with the calendar user specified by the property.

func Delegatee

func Delegatee(v ...string) Parameter

Delegatee names the calendar users to whom the calendar user specified by the property has delegated participation.

func Delegator

func Delegator(v ...string) Parameter

Delegator names the calendar users that have delegated their participation to the calendar user(s) specified by the property.

func Dir

func Dir(v string) Parameter

Dir specifies reference to a directory entry associated with the calendar user specified by the property.

func Email

func Email(v string) Parameter

Email specifies an email address that is used to identify or contact an organizer or attendee.

func Encoding

func Encoding(base64 bool) Parameter

Encoding specifies an alternate inline encoding for the property value.

func FmtType

func FmtType(mediaType string) Parameter

FmtType specifies the content type of a referenced object, e.g. "image/png".

func FmtTypeOf

func FmtTypeOf(typeName, subTypeName string) Parameter

FmtTypeOf specifies the content type of a referenced object, e.g. "image", "png".

func Label

func Label(v string) Parameter

Label provides a human-readable label.

func Language

func Language(v string) Parameter

Language specifies the language for text values in a property or property parameter. See https://tools.ietf.org/html/rfc5646

func Member

func Member(v ...string) Parameter

Member specifies the group or list membership of the calendar user specified by the property.

func Multiple

func Multiple(k string, v []string) Parameter

func Rsvp

func Rsvp(yes bool) Parameter

Rsvp specifies whether there is an expectation of a reply from the calendar user specified by the property value.

func SentBy

func SentBy(v string) Parameter

SentBy specifies the calendar user that is acting on behalf of the calendar user specified by the property.

func Single

func Single(k, v string) Parameter

Single returns a Parameter with a single string value.

func TZid

func TZid(v string) Parameter

TZid specifies the identifier for the time zone definition for a time component in the property value.

func (Parameter) Equals

func (p Parameter) Equals(q Parameter) bool

Equals tests whether two parameters have the same key and the same value(s).

func (Parameter) WriteTo

func (p Parameter) WriteTo(w ics.StringWriter) error

WriteTo serialises the parameter in iCalendar ics format to the writer. Parameters with multiple values are serialised using a comma-separated list.

Parameters with values containing a COLON character, a SEMICOLON character or a COMMA character are placed in quoted text.

type Parameters

type Parameters []Parameter

Parameters holds a set of key-value parameters.

func (Parameters) Append

func (pp Parameters) Append(ps ...Parameter) Parameters

Append appends a parameter (or parameters), ensuring that keys remain unique.

func (Parameters) Prepend

func (pp Parameters) Prepend(ps ...Parameter) Parameters

Prepend appends a parameter (or parameters), ensuring that keys remain unique.

func (Parameters) RemoveByKey

func (pp Parameters) RemoveByKey(key ...string) Parameters

RemoveByKey removes all parameters with a key (or keys) from the list.

func (Parameters) WriteTo

func (pp Parameters) WriteTo(w ics.StringWriter) error

WriteTo serialises the parameters in iCalendar ics format to the writer.

Directories

Path Synopsis
Package cuvalue enumerates values for calendar user types.
Package cuvalue enumerates values for calendar user types.
Package display enumerates values for the display parameter.
Package display enumerates values for the display parameter.
Package feature enumerates values for the feature parameter.
Package feature enumerates values for the feature parameter.
Package freebusy enumerates values for the free-busy parameter.
Package freebusy enumerates values for the free-busy parameter.
Package partstat enumerates values for the participation status parameter.
Package partstat enumerates values for the participation status parameter.
Package role enumerates values for the participation role parameter.
Package role enumerates values for the participation role parameter.
Package valuetype enumerates values of the type options for parameters (the VALUE parameter).
Package valuetype enumerates values of the type options for parameters (the VALUE parameter).

Jump to

Keyboard shortcuts

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