This repository has been archived by the owner on Jun 27, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3217fc9
commit 323a611
Showing
4 changed files
with
105 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package drivers | ||
|
||
import ( | ||
"net/http" | ||
|
||
"github.com/danilopolani/gocialite/structs" | ||
) | ||
|
||
// GithubUserMap is the map to create the User struct | ||
var GithubUserMap = map[string]string{ | ||
"id": "ID", | ||
"email": "Email", | ||
"login": "Username", | ||
"avatar_url": "Avatar", | ||
"name": "FullName", | ||
} | ||
|
||
// GithubAPIMap is the map for API endpoints | ||
var GithubAPIMap = map[string]string{ | ||
"endpoint": "https://api.github.com", | ||
"userEndpoint": "/user", | ||
} | ||
|
||
// GithubUserFn is a callback to parse additional fields for User | ||
var GithubUserFn = func(client *http.Client, u *structs.User) {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package drivers | ||
|
||
import ( | ||
"net/http" | ||
|
||
"github.com/danilopolani/gocialite/structs" | ||
) | ||
|
||
// LinkedInUserMap is the map to create the User struct | ||
var LinkedInUserMap = map[string]string{ | ||
"id": "ID", | ||
"vanityName": "Username", | ||
"firstName": "FirstName", | ||
"lastName": "LastName", | ||
"formattedName": "FullName", | ||
"emailAddress": "Email", | ||
"pictureUrl": "Avatar", | ||
} | ||
|
||
// LinkedInAPIMap is the map for API endpoints | ||
var LinkedInAPIMap = map[string]string{ | ||
"endpoint": "https://api.linkedin.com", | ||
"userEndpoint": "/v1/people/~:(id,first-name,last-name,formatted-name,email-address,picture-url,maiden-name,headline,location,industry,current-share,num-connections,summary,specialties,positions,public-profile-url)?format=json", | ||
} | ||
|
||
// LinkedInUserFn is a callback to parse additional fields for User | ||
var LinkedInUserFn = func(client *http.Client, u *structs.User) {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package structs | ||
|
||
// User struct | ||
type User struct { | ||
ID string `json:"id"` | ||
Username string `json:"username"` | ||
FirstName string `json:"first_name"` | ||
LastName string `json:"last_name"` | ||
FullName string `json:"full_name"` | ||
Email string `json:"email"` | ||
Avatar string `json:"avatar"` | ||
Raw map[string]interface{} `json:"raw"` // Raw data | ||
} |