Documentation ¶
Index ¶
- func CreateOauthUser(c *gin.Context, oauthUser *OauthUser, connection *model.Connection) (model.User, int, error)
- func FacebookURL() (string, int)
- func GithubURL() (string, int)
- func GoogleURL() (string, int)
- func KakaoURL() (string, int)
- func LinkedinURL() (string, int)
- func LoginOrCreateOauthUser(c *gin.Context, oauthUser *OauthUser, providerId uint, token *oauth2.Token) (int, error)
- func LoginWithOauthUser(c *gin.Context, token string) (int, error)
- func NaverURL() (string, int)
- func OauthFacebook(c *gin.Context) (int, error)
- func OauthGithub(c *gin.Context) (int, error)
- func OauthGoogle(c *gin.Context) (int, error)
- func OauthKakao(c *gin.Context) (int, error)
- func OauthLinkedin(c *gin.Context) (int, error)
- func OauthNaver(c *gin.Context) (int, error)
- func OauthTwitter(c *gin.Context) (int, error)
- func OauthYahoo(c *gin.Context) (int, error)
- func RetrieveOauthStatus(c *gin.Context) (oauthStatusMap, int, error)
- func RevokeFacebook(c *gin.Context) (map[string]bool, int, error)
- func RevokeGithub(c *gin.Context) (map[string]bool, int, error)
- func RevokeGoogle(c *gin.Context) (map[string]bool, int, error)
- func RevokeKakao(c *gin.Context) (map[string]bool, int, error)
- func RevokeLinkedin(c *gin.Context) (map[string]bool, int, error)
- func RevokeNaver(c *gin.Context) (map[string]bool, int, error)
- func RevokeOauth(c *gin.Context, providerId int64) (oauthStatusMap, int, error)
- func RevokeTwitter(c *gin.Context) (map[string]bool, int, error)
- func RevokeYahoo(c *gin.Context) (map[string]bool, int, error)
- func TwitterURL() (string, int)
- func YahooURL() (string, int)
- type Email
- type FacebookUser
- type GithubUser
- type GoogleUser
- type Image
- type KakaoUser
- type LinkedinUser
- type NaverUser
- type OauthUser
- type TwitterUser
- type YahooUser
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateOauthUser ¶
func CreateOauthUser(c *gin.Context, oauthUser *OauthUser, connection *model.Connection) (model.User, int, error)
CreateOauthUser creates oauth user.
func LoginOrCreateOauthUser ¶
func LoginOrCreateOauthUser(c *gin.Context, oauthUser *OauthUser, providerId uint, token *oauth2.Token) (int, error)
LoginOrCreateOauthUser login or create with oauthUser
func LoginWithOauthUser ¶
LoginWithOauthUser login with oauthUser's username.
func OauthFacebook ¶
OauthFacebook link connection and user.
func OauthGithub ¶
OauthGithub link connection and user.
func OauthGoogle ¶
OauthGoogle link connection and user.
func OauthLinkedin ¶
OauthLinkedin link connection and user.
func OauthTwitter ¶
OauthTwitter link connection and user.
func RetrieveOauthStatus ¶
RetrieveOauthStatus retrieves ouath status that provider connected or not.
func RevokeFacebook ¶
RevokeFacebook revokes facebook oauth connection.
func RevokeGithub ¶
RevokeGithub revokes github oauth connection.
func RevokeGoogle ¶
RevokeGoogle revokes google oauth connection.
func RevokeKakao ¶
RevokeKakao revokes kakao oauth connection.
func RevokeLinkedin ¶
RevokeLinkedin revokes linkedin oauth connection.
func RevokeNaver ¶
RevokeNaver revokes naver oauth connection.
func RevokeOauth ¶
RevokeOauth revokes oauth connection.
func RevokeTwitter ¶
RevokeTwitter revokes twitter oauth connection.
func RevokeYahoo ¶
RevokeYahoo revokes yahoo oauth connection.
Types ¶
type Email ¶
type Email struct { Value string `json:"value" binding:"required"` Type string `json:"type" binding:"required"` }
Email is a struct that contained googleUser's email.
type FacebookUser ¶
type FacebookUser struct { ID string `json:"id"` Username string `json:"name"` ProfileUrl string `json:"link"` }
FacebookUser is a struct that contained facebook user information.
func SetFacebookUser ¶
func SetFacebookUser(response *http.Response) (*FacebookUser, error)
SetFacebookUser set facebook user.
type GithubUser ¶
type GithubUser struct { UserID int `json:"id"` Email string `json:"email"` Username string `json:"login"` Name string `json:"name""` ImageUrl string `json:"avatar_url"` ProfileUrl string `json:"html_url"` }
GithubUser is a struct that contained github user information.
func SetGithubUser ¶
func SetGithubUser(response *http.Response) (*GithubUser, error)
SetGithubUser set github user.
type GoogleUser ¶
type GoogleUser struct { ID string `json:"id"` Username string `json:"nickname"` Emails []Email `json:"emails"` Name string `json:"displayName"` Image Image `json:"image"` ProfileUrl string `json:"url"` }
GoogleUser is a struct that contained google user information.
func SetGoogleUser ¶
func SetGoogleUser(response *http.Response) (*GoogleUser, error)
SetGoogleUser set google user.
type Image ¶
type Image struct { URL string `json:"url" binding:"required"` IsDefault string `json:"isDefault" binding:"required"` }
Image is a struct that contained googleUser's image meta data.
type KakaoUser ¶
type KakaoUser struct { ID string `json:"id"` Email string `json:"email"` Username string `json:"login"` Name string `json:"name""` ImageUrl string `json:"avatar_url"` ProfileUrl string `json:"html_url"` }
KakaoUser is a struct that contained kakao user information.
type LinkedinUser ¶
type LinkedinUser struct { ID string `json:"id"` Email string `json:"emailAddress"` Username string `json:"firstName"` Name string `json:"lastName""` ImageUrl string `json:"pictureUrl"` ProfileUrl string `json:"publicProfileUrl"` }
LinkedinUser is a struct that contained linkedin user information.
func SetLinkedinUser ¶
func SetLinkedinUser(response *http.Response) (*LinkedinUser, error)
SetLinkedinUser set linkedin user.
type NaverUser ¶
type NaverUser struct {}
NaverUser is a struct that contained naver user information.
type OauthUser ¶
type OauthUser struct { ID string Email string Username string Name string ImageUrl string ProfileUrl string }
OauthUser is a struct for connection.
type TwitterUser ¶
type TwitterUser struct { ID string `json:"id"` Email string `json:"email"` Name string `json:"name"` Username string `json:"screen_name"` ProfileUrl string `json:"url"` ImageUrl string `json:"profile_image_url"` }
TwitterUser is a struct that contained twitter user information.
func SetTwitterUser ¶
func SetTwitterUser(response *http.Response) (*TwitterUser, error)
SetTwitterUser set twitter user.