contact

package
v0.55.1 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2024 License: BSD-3-Clause Imports: 1 Imported by: 0

README

GoDoc Go Report Card

contact

The Go library to manage contacts.

Features

  • Import Google's contacts v3 with OAuth2
  • Import Yahoo's contacts with OAuth2
  • Import Microsoft's Live/Outlook contacts with OAuth2

TODO

  • VCard 4.0 Encode and Decode

Documentation

Overview

Package contact provide a library to import contact from Google, Microsoft, and Yahoo.

Index

Constants

View Source
const (
	KindIndividual = "individual"
	KindGroup      = "group"
	KindOrg        = "org"
	KindLocation   = "location"
)

List of Kind values.

View Source
const (
	TypeAnniversary = "anniversary"
	TypeHome        = "home"
	TypeMain        = "main"
	TypeMobile      = "mobile"
	TypeOther       = "other"
	TypeWork        = "work"
)

List of known TYPE values.

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address struct {
	Type        string `json:"type,omitempty"`
	POBox       string `json:"pobox,omitempty"`
	Ext         string `json:"extension,omitempty"`
	Street      string `json:"street,omitempty"`
	City        string `json:"city,omitempty"`
	StateOrProv string `json:"stateOrProvince,omitempty"`
	PostalCode  string `json:"postalCode,omitempty"`
	Country     string `json:"country,omitempty"`
}

Address define contact's address.

type Date

type Date struct {
	Day   string `json:"day"`
	Month string `json:"month"`
	Year  string `json:"year"`
}

Date define contact's with type "birthday" and "anniversary".

func (*Date) String

func (date *Date) String() (r string)

String will return the string representation of date object in `YYYY-MM-DD` format.

func (*Date) VCardString

func (date *Date) VCardString() (r string)

VCardString will return the string representation of date object in VCard format: `YYYYMMDD` or "--MMDD" if year is empty.

type Email

type Email struct {
	Type    string
	Address string
}

Email contains, yes, electronic mail address.

type Name

type Name struct {
	Given       string `json:"givenName"`
	Middle      string `json:"middleName"`
	Family      string `json:"familyName"`
	Prefix      string `json:"prefix"`
	Suffix      string `json:"suffix"`
	GivenSound  string `json:"givenNameSound"`
	FamilySound string `json:"familyNameSound"`
}

Name define contact's name.

type Phone

type Phone struct {
	Type   string
	Number string
}

Phone define contact phone number and their type.

type Record

type Record struct {
	Name Name

	Birthday    *Date
	Anniversary *Date

	Company  string
	JobTitle string

	Addresses []Address
	Emails    []Email
	Phones    []Phone
	Links     []string
	Notes     []string
}

Record define a single contact entity with sane format.

func (*Record) SetAnniversary

func (contact *Record) SetAnniversary(dateStr string)

SetAnniversary will set contact annivery from string format "YYYY-MM-DD".

func (*Record) SetBirthday

func (contact *Record) SetBirthday(dateStr string)

SetBirthday will set contact birthday from string format "YYYY-MM-DD" or "YYYY-MM-DDTHH:MM:SSZ".

Directories

Path Synopsis
Package google implement Google's contact API v3.
Package google implement Google's contact API v3.
Package microsoft implement Microsoft's Live contact API v1.0.
Package microsoft implement Microsoft's Live contact API v1.0.
Package vcard implement RFC6350 for encoding and decoding VCard formatted data.
Package vcard implement RFC6350 for encoding and decoding VCard formatted data.
Package yahoo implement user's contacts import using Yahoo API.
Package yahoo implement user's contacts import using Yahoo API.

Jump to

Keyboard shortcuts

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