package yahoo
import "git.sr.ht/~shulhan/pakakeh.go/lib/contact/yahoo"
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 ¶
const ( FieldTypeAddress = "address" FieldTypeBirthday = "birthday" FieldTypeCompany = "company" FieldTypeEmail = "email" FieldTypeJobTitle = "jobTitle" FieldTypeLink = "link" FieldTypeName = "name" FieldTypePhone = "phone" )
List of field type.
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.
func ParseJSON ¶
ParseJSON will parse JSON input and return contact.Record object on success.
On fail it will return nil and error.
Types ¶
type Category ¶
Category define a contact category.
type Contact ¶
type Contact struct { Fields []Field `json:"fields"` }
Contact define the contact item in response.
func (*Contact) Decode ¶
Decode will convert the interface value in each field into its struct representation.
type Contacts ¶
type Contacts struct { URI string `json:"uri"` Contact []Contact `json:"contact"` Start int `json:"start"` Count int `json:"count"` Total int `json:"total"` }
Contacts define the holder for root of contacts response.
type Field ¶
type Field struct { Type string `json:"type"` Value any `json:"value"` Flags []string `json:"flags"` }
Field define a composite attribute in Contact. Known value for Type: "phone", "name", "address".
func (*Field) Decode ¶
Decode will convert Yahoo' contact field value and save it to contact Contact format.
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.
type Meta2 ¶
type Meta2 struct { Created string `json:"created"` Updated string `json:"updated"` URI string `json:"uri"` }
Meta2 define a common metadata inside a struct.
type Root ¶
type Root struct { Contacts Contacts `json:"contacts"` }
Root define the root of JSON response.
Source Files ¶
category.go contact.go contacts.go field.go meta.go meta2.go root.go yahoo.go
- Version
- v0.60.0 (latest)
- Published
- Feb 1, 2025
- Platform
- linux/amd64
- Imports
- 7 packages
- Last checked
- 16 minutes ago –
Tools for package owners.