Documentation ¶
Index ¶
Constants ¶
const ( // TelHome is a telephone number associated with a residence TelHome = "home" // TelMsg indicates that the telephone number has voice messaging support TelMsg = "msg" // TelWork indicates a telephone number associated with a place of work TelWork = "work" // TelPref indicates a preferred-use telephone number TelPref = "pref" // TelVoice indicates a voice telephone number TelVoice = "voice" // TelFax indicates a facsimile telephone number TelFax = "fax" // TelCell indicates a cellular phone number TelCell = "cell" // TelVideo indicates video calling support TelVideo = "video" // TelPager indicates a paging device telephone number TelPager = "pager" // TelBBS indicates a buletin board system telephone number TelBBS = "bbs" // TelModem indicates a moden telephone number TelModem = "modem" // TelCar indicates a car-phone telephone TelCar = "car" // TelISDN indicates an ISDN service telephone number TelISDN = "isdn" // TelPCS indicates a personal communication service telephone number TelPCS = "pcs" )
const ( // AdrDom indicates a domestic address. AdrDom = "dom" // AdrIntl indicates an international address. AdrIntl = "intl" // AdrPostal indicates a postal address. AdrPostal = "postal" // AdrParcel indicates a parcel delivery address. AdrParcel = "parcel" // AdrHome indicates a home delivery address. AdrHome = "home" // AdrWork indicates a delivery address for a place of work. AdrWork = "work" // AdrPref indicates a preferred address for when more addresses are supplied. AdrPref = "pref" )
const ( // EmailInternet indicates an internet addressing type. EmailInternet = "internet" // EmailX400 indicates a X.400 addressing type. EmailX400 = "x400" // EmailPref indicates a preferred address for when more addresses are supplied EmailPref = "pref" )
Variables ¶
var ErrVersion = errors.New("unsupported verson")
ErrVersion is used by FieldFormatters when a request is made for an unsupported vcard version
Functions ¶
This section is empty.
Types ¶
type Adr ¶
type Adr struct { Types []string PostOfficeBox string ExtendedAddress string StreetAddress string Locality string Region string PostalCode string CountryName string }
Adr type definition to specify the components of the delivery address for the vCard object.
type Agent ¶
Agent type definition to specify information about another person who will act on behalf of the individual or resource associated with the vCard. Can contain a VCard of the agent or a string.
type Anniversary ¶
Anniversary type definition to specify a person's anniversary/
type Bday ¶
Bday type definition to specify the date of birth of the individual associated with the vCard.
type Email ¶
Email type definition to specify the formatted text corresponding to the name of the object the vCard represents.
type FN ¶
type FN struct {
FormattedName string
}
FN type definition to specify the formatted text corresponding to the name of the object the vCard represents.
type FbURL ¶
FbURL type definition to specify a URL that shows when the person is "free" or "busy" on their calendar.
type FieldFormatter ¶
FieldFormatter is an interface containing the minimal behaviour of any VCard field formatter Receives the version as a string, returns a formatted string and an error Current versions to support are 2.1, 3.0 and 4,0
type Gender ¶
type Gender struct {
Val string
}
Gender type definition to specify a person's gender.
type Key ¶
Key type definition to specify a key associated with the vCard object. It may point to an external URL, may be plain text, or may be embedded in the vCard as a Base64 encoded block of text.
type Kind ¶
type Kind struct {
Text string
}
Kind type definition to specify the the type of entity that this vCard represents: 'application', 'individual', 'group', 'location' or 'organization'; 'x-*' values may be used for experimental purposes.
type N ¶
type N struct { FamilyName string GivenName string AdditionalNames string HonorificPrefixes string HonorificSuffixes string }
N type definition to specify the components of the name of the object the vCard represents
type Org ¶
Org type definition to specify the organizational name and units associated with the vCard.
type Photo ¶
Photo type definition to specify an image or photograph information that annotates some aspect of the object the vCard represents.
type Role ¶
type Role struct {
Role string
}
Role type definition to specify information concerning the role, occupation, or business category of the object the vCard represents.
type Tel ¶
Tel type definition to the telephone number for telephony communication with the object the vCard represents.
type Title ¶
type Title struct {
Title string
}
Title type definition to specify the job title, functional position or function of the object the vCard represents.
type VCard ¶
type VCard struct { Version string Fields []FieldFormatter }
VCard represents a formattable vcard
func New ¶
func New(v string, fields ...FieldFormatter) (*VCard, error)
New returns a new VCard based upon the provided version and fields, returns an error if an invalid version is provided or if validation of the vcard fails
type VersionError ¶
type VersionError struct{}
VersionError is used to to return an error when the user has selected a wrong version
func (*VersionError) Error ¶
func (err *VersionError) Error() string
Error implements the error interface