Documentation ¶
Overview ¶
Package yahoo implement user's contacts import using Yahoo API.
Reference ¶
- https://developer.yahoo.com/social/rest_api_guide/contacts-resource.html
Index ¶
- Constants
- func ImportFromJSON(jsonb []byte) (contacts []*contact.Record, err error)
- func ImportWithOAuth(client *http.Client, guid string) (contacts []*contact.Record, err error)
- func ParseJSON(jsonb []byte) (to *contact.Record, err error)
- type Category
- type Contact
- type Contacts
- type Field
- type Meta
- type Meta2
- type Root
Constants ¶
View Source
const ( FieldTypeAddress = "address" FieldTypeBirthday = "birthday" FieldTypeCompany = "company" FieldTypeEmail = "email" FieldTypeJobTitle = "jobTitle" FieldTypeLink = "link" FieldTypeName = "name" FieldTypePhone = "phone" )
List of field type.
Variables ¶
This section is empty.
Functions ¶
func ImportFromJSON ¶
ImportFromJSON will parse JSON input and return list of Contact on success.
On fail it will return nil and error.
func ImportWithOAuth ¶
ImportWithOAuth get Yahoo contacts using OAuth HTTP client.
Types ¶
type Contact ¶
type Contact struct {
Fields []Field `json:"fields"`
}
Contact define the contact item in response.
type Contacts ¶
type Contacts struct { Contact []Contact `json:"contact"` Start int `json:"start"` Count int `json:"count"` Total int `json:"total"` URI string `json:"uri"` }
Contacts define the holder for root of contacts response.
type Field ¶
type Field struct { Type string `json:"type"` Value interface{} `json:"value"` Flags []string `json:"flags"` }
Field define a composite attribute in Contact. Known value for Type: "phone", "name", "address".
type Meta ¶
type Meta struct { Created time.Time `json:"created"` Updated time.Time `json:"updated"` URI string `json:"uri"` }
Meta define a common metadata inside a struct.
Click to show internal directories.
Click to hide internal directories.