oauthService

package
v0.0.0-...-dffa276 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 29, 2023 License: MIT Imports: 25 Imported by: 3

Documentation

Index

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 FacebookURL

func FacebookURL() (string, int)

FacebookURL return facebook auth url.

func GithubURL

func GithubURL() (string, int)

GithubURL return github auth url.

func GoogleURL

func GoogleURL() (string, int)

GoogleURL return google auth url.

func KakaoURL

func KakaoURL() (string, int)

KakaoURL return kakao auth url.

func LinkedinURL

func LinkedinURL() (string, int)

LinkedinURL return linkedin auth url.

func LoginOrCreateOauthUser

func LoginOrCreateOauthUser(c *gin.Context, oauthUser *OauthUser, providerId uint, token *oauth2.Token) (int, error)

LoginOrCreateOauthUser login or create with oauthUser

func LoginWithOauthUser

func LoginWithOauthUser(c *gin.Context, token string) (int, error)

LoginWithOauthUser login with oauthUser's username.

func NaverURL() (string, int)

NaverURL return naver auth url.

func OauthFacebook

func OauthFacebook(c *gin.Context) (int, error)

OauthFacebook link connection and user.

func OauthGithub

func OauthGithub(c *gin.Context) (int, error)

OauthGithub link connection and user.

func OauthGoogle

func OauthGoogle(c *gin.Context) (int, error)

OauthGoogle link connection and user.

func OauthKakao

func OauthKakao(c *gin.Context) (int, error)

OauthKakao link connection and user.

func OauthLinkedin

func OauthLinkedin(c *gin.Context) (int, error)

OauthLinkedin link connection and user.

func OauthNaver

func OauthNaver(c *gin.Context) (int, error)

OauthNaver link connection and user.

func OauthTwitter

func OauthTwitter(c *gin.Context) (int, error)

OauthTwitter link connection and user.

func OauthYahoo

func OauthYahoo(c *gin.Context) (int, error)

OauthYahoo link connection and user.

func RetrieveOauthStatus

func RetrieveOauthStatus(c *gin.Context) (oauthStatusMap, int, error)

RetrieveOauthStatus retrieves ouath status that provider connected or not.

func RevokeFacebook

func RevokeFacebook(c *gin.Context) (map[string]bool, int, error)

RevokeFacebook revokes facebook oauth connection.

func RevokeGithub

func RevokeGithub(c *gin.Context) (map[string]bool, int, error)

RevokeGithub revokes github oauth connection.

func RevokeGoogle

func RevokeGoogle(c *gin.Context) (map[string]bool, int, error)

RevokeGoogle revokes google oauth connection.

func RevokeKakao

func RevokeKakao(c *gin.Context) (map[string]bool, int, error)

RevokeKakao revokes kakao oauth connection.

func RevokeLinkedin

func RevokeLinkedin(c *gin.Context) (map[string]bool, int, error)

RevokeLinkedin revokes linkedin oauth connection.

func RevokeNaver

func RevokeNaver(c *gin.Context) (map[string]bool, int, error)

RevokeNaver revokes naver oauth connection.

func RevokeOauth

func RevokeOauth(c *gin.Context, providerId int64) (oauthStatusMap, int, error)

RevokeOauth revokes oauth connection.

func RevokeTwitter

func RevokeTwitter(c *gin.Context) (map[string]bool, int, error)

RevokeTwitter revokes twitter oauth connection.

func RevokeYahoo

func RevokeYahoo(c *gin.Context) (map[string]bool, int, error)

RevokeYahoo revokes yahoo oauth connection.

func TwitterURL

func TwitterURL() (string, int)

TwitterURL return twitter auth url.

func YahooURL

func YahooURL() (string, int)

YahooURL return yahoo auth url.

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.

func SetKakaoUser

func SetKakaoUser(response *http.Response) (*KakaoUser, error)

SetKakaoUser set kakao user.

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 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"`
}

NaverUser is a struct that contained naver user information.

func SetNaverUser

func SetNaverUser(response *http.Response) (*NaverUser, error)

SetNaverUser set naver user.

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.

type YahooUser

type YahooUser struct {
	ID         string `json:"guid"`
	Email      string `json:"email"`
	Name       string `json:"nickname"`
	Username   string `json:"nickname"`
	ImageUrl   string `json:"imageURL"`
	ProfileUrl string `json:"profileURL"`
}

YahooUser is a struct that contained yahoo user information.

func SetYahooUser

func SetYahooUser(response *http.Response) (*YahooUser, error)

SetYahooUser set yahoo user.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL