Documentation ¶
Overview ¶
Package google implement Google's contact API v3.
Index ¶
- func ImportFromJSON(jsonb []byte) (contacts []*contact.Record, err error)
- func ImportWithOAuth(client *http.Client) (contacts []*contact.Record, err error)
- func ParseRel(in string) string
- type Address
- type Author
- type Birthday
- type Category
- type Contact
- type Email
- type Event
- type EventTime
- type Feed
- type GD
- type Generator
- type Link
- type Name
- type Org
- type Phone
- type Root
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ImportFromJSON ¶
ImportFromJSON will parse JSON input and return Contacts object on success.
On fail it will return nil and error.
func ImportWithOAuth ¶
ImportWithOAuth get Google contact API using OAuth HTTP client.
Types ¶
type Address ¶
type Address struct { Rel string `json:"rel,omitempty"` Full GD `json:"gd$formattedAddress,omitempty"` POBox GD `json:"gd$pobox,omitempty"` Street GD `json:"gd$street,omitempty"` City GD `json:"gd$city,omitempty"` StateOrProv GD `json:"gd$region,omitempty"` PostalCode GD `json:"gd$postcode,omitempty"` Country GD `json:"gd$country,omitempty"` }
Address format.
type Category ¶
type Category struct { Scheme string `json:"scheme,omitempty"` Term string `json:"term,omitempty"` }
Category format.
type Contact ¶
type Contact struct { Name Name `json:"gd$name,omitempty"` Birthday Birthday `json:"gContact$birthday,omitempty"` Orgs []Org `json:"gd$organization,omitempty"` Emails []Email `json:"gd$email,omitempty"` Phones []Phone `json:"gd$phoneNumber,omitempty"` Addresses []Address `json:"gd$structuredPostalAddress,omitempty"` Events []Event `json:"gContact$event,omitempty"` Websites []Link `json:"gContact$website,omitempty"` }
Contact define a single Google contact data.
Some of the fields are disabled for speed.
type Email ¶
type Email struct { Rel string `json:"rel,omitempty"` Address string `json:"address,omitempty"` Primary string `json:"primary,omitempty"` }
Email format.
type EventTime ¶
type EventTime struct {
Start string `json:"startTime,omitempty"`
}
EventTime format.
type Feed ¶
type Feed struct { TotalResult GD `json:"openSearch$totalResults,omitempty"` Contacts []Contact `json:"entry,omitempty"` }
Feed define content of Google contacts feed metadata.
Some of the fields are disabled for speed.
type Generator ¶
type Generator struct { Version string `json:"version,omitempty"` URI string `json:"uri,omitempty"` Value string `json:"$t,omitempty"` }
Generator define Google contact generator.
type Link ¶
type Link struct { Rel string `json:"rel,omitempty"` Type string `json:"type,omitempty"` HRef string `json:"href,omitempty"` }
Link define Google contact link type.
type Name ¶
type Name struct { Prefix GD `json:"gd$namePrefix,omitempty"` First GD `json:"gd$givenName,omitempty"` Middle GD `json:"gd$additionalName,omitempty"` Last GD `json:"gd$familyName,omitempty"` Suffix GD `json:"gd$nameSuffix,omitempty"` Full GD `json:"gd$fullName,omitempty"` }
Name define Google contact name format.
type Org ¶
type Org struct { Type string `json:"rel,omitempty"` Name GD `json:"gd$orgName,omitempty"` JobTitle GD `json:"gd$orgTitle,omitempty"` }
Org as organisation.
Click to show internal directories.
Click to hide internal directories.