vcard

package module
v0.0.0-...-ba3d3b4 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2017 License: BSD-2-Clause Imports: 3 Imported by: 4

Documentation

Overview

See RFC 2425 Mime Content-Type for Directory Information

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address struct {
	Type            []string // default is Intl,Postal,Parcel,Work
	Label           string
	PostOfficeBox   string
	ExtendedAddress string
	Street          string
	Locality        string // e.g: city
	Region          string // e.g: state or province
	PostalCode      string
	CountryName     string
}

func (*Address) WriteTo

func (addr *Address) WriteTo(di *DirectoryInfoWriter)

type AddressBook

type AddressBook struct {
	Contacts []VCard
}

func (*AddressBook) LastContact

func (ab *AddressBook) LastContact() *VCard

func (*AddressBook) ReadFrom

func (ab *AddressBook) ReadFrom(di *DirectoryInfoReader)

func (*AddressBook) WriteTo

func (ab *AddressBook) WriteTo(di *DirectoryInfoWriter)

type ContentLine

type ContentLine struct {
	Group, Name string
	Params      map[string]Value
	Value       StructuredValue
}

type DataType

type DataType interface {
	GetType() []string
	HasType(t string) bool
}

type DirectoryInfoReader

type DirectoryInfoReader struct {
	// contains filtered or unexported fields
}

func NewDirectoryInfoReader

func NewDirectoryInfoReader(reader io.Reader) *DirectoryInfoReader

func (*DirectoryInfoReader) ReadContentLine

func (di *DirectoryInfoReader) ReadContentLine() *ContentLine

type DirectoryInfoWriter

type DirectoryInfoWriter struct {
	// contains filtered or unexported fields
}

Permit to serialize Directory Information data as defined by RFC 2425

func NewDirectoryInfoWriter

func NewDirectoryInfoWriter(writer io.Writer) *DirectoryInfoWriter

create a new DirectoryInfoWriter

func (*DirectoryInfoWriter) WriteContentLine

func (di *DirectoryInfoWriter) WriteContentLine(contentLine *ContentLine)

func (*DirectoryInfoWriter) WriteValue

func (di *DirectoryInfoWriter) WriteValue(value string)

this function escape '\n' '\r' ';' ',' character with the '\\' character

type Email

type Email struct {
	Type    []string
	Address string
}

func (*Email) WriteTo

func (email *Email) WriteTo(di *DirectoryInfoWriter)

type Photo

type Photo struct {
	Encoding string
	Type     string
	Value    string
	Data     string
}

func (*Photo) WriteTo

func (photo *Photo) WriteTo(di *DirectoryInfoWriter)

type StructuredValue

type StructuredValue []Value

values separated by ';' has a structural meaning

func (StructuredValue) GetText

func (v StructuredValue) GetText() string

func (StructuredValue) GetTextList

func (sv StructuredValue) GetTextList() []string

type Telephone

type Telephone struct {
	Type   []string
	Number string
}

func (*Telephone) WriteTo

func (tel *Telephone) WriteTo(di *DirectoryInfoWriter)

type VCard

type VCard struct {
	Version           string
	FormattedName     string
	FamilyNames       []string
	GivenNames        []string
	AdditionalNames   []string
	HonorificNames    []string
	HonorificSuffixes []string
	NickNames         []string
	Photo             Photo
	Birthday          string
	Addresses         []Address
	Telephones        []Telephone
	Emails            []Email
	Title             string
	Role              string
	Org               []string
	Categories        []string
	Note              string
	URL               string
	XJabbers          []XJabber
	XSkypes           []XSkype
	// mac specific
	XABuid    string
	XABShowAs string
}

func (*VCard) ReadFrom

func (vcard *VCard) ReadFrom(di *DirectoryInfoReader)

func (VCard) String

func (v VCard) String() (s string)

func (*VCard) WriteTo

func (vcard *VCard) WriteTo(di *DirectoryInfoWriter)

type Value

type Value []string

values seprated by ',' is a multi value

func (Value) GetText

func (v Value) GetText() string

type XJabber

type XJabber struct {
	Type    []string
	Address string
}

func (*XJabber) WriteTo

func (jab *XJabber) WriteTo(di *DirectoryInfoWriter)

type XSkype

type XSkype struct {
	Type    []string
	Address string
}

func (*XSkype) WriteTo

func (skype *XSkype) WriteTo(di *DirectoryInfoWriter)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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