Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewFacebookOAuth ¶
Types ¶
type FacebookOAuthMethod ¶
type FacebookOAuthMethod interface {
// GenerateOAuthURL is a function to generate oauth url for user to login
GenerateOAuthURL(state string) (oauthURL string)
// GetAccessToken is a function to get user access token by code that response from facebook
GetUserAccessToken(code string) (returnData ReturnFacebookGetUserAccessToken, err error)
// GetAppAccessToken is a function to get app access token
GetAppAccessToken() (returnData ReturnFacebookGetAppAccessToken, err error)
// GetTokenInfo is a function to get token info from facebook server
GetTokenInfo(param ParamFacebookGetTokenInfo) (returnData ReturnFacebookGetTokenInfo, err error)
// GetUserInfo is a function to get user info from facebook server
GetUserInfo(accessToken string) (returnData ReturnFacebookGetUserInfo, err error)
}
type ReturnFacebookGetTokenInfo ¶
type ReturnFacebookGetTokenInfo struct {
Data struct {
AppID string `json:"app_id"`
Type string `json:"type"`
Application string `json:"application"`
DataAccessExpiresAt int `json:"data_access_expires_at"`
ExpiresAt int `json:"expires_at"`
IsValid bool `json:"is_valid"`
IssuedAt int `json:"issued_at"`
Scopes []string `json:"scopes"`
UserID string `json:"user_id"`
} `json:"data"`
}
type ReturnFacebookGetUserInfo ¶
type ReturnFacebookGetUserInfo struct {
ID string `json:"id"`
Name *string `json:"name"`
Email *string `json:"email"`
Picture *struct {
Data *struct {
Height *int `json:"height"`
IsSilhouette *bool `json:"is_silhouette"`
URL *string `json:"url"`
Width *int `json:"width"`
} `json:"data"`
} `json:"picture"`
}
Click to show internal directories.
Click to hide internal directories.