Documentation ¶
Index ¶
- func CreateToken(res http.ResponseWriter, req *http.Request, userID uint) error
- func DeleteToken(res http.ResponseWriter, req *http.Request) error
- func ExtractToken(r *http.Request) string
- func ExtractTokenID(r *http.Request) (uint32, error)
- func Pretty(data interface{})
- func TokenValid(r *http.Request) error
- type Config
- type Database
- type User
- func (user *User) DeleteUserByID(db *gorm.DB, uid uint32) (int64, error)
- func (user *User) FindAllUsers(db *gorm.DB) (*[]User, error)
- func (user *User) FindUserByEMail(db *gorm.DB, email string) (*User, error)
- func (user *User) FindUserByID(db *gorm.DB, uid uint32) (*User, error)
- func (user *User) FromGothUser(gothuser goth.User) error
- func (user *User) SaveUser(db *gorm.DB) (*User, error)
- func (user *User) UpdateUser(db *gorm.DB, uid uint32) (*User, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateToken ¶
CreateToken : creates a new jwt token
func DeleteToken ¶
func DeleteToken(res http.ResponseWriter, req *http.Request) error
DeleteToken : creates a new empty token
func ExtractToken ¶
ExtractToken : extract token info from request
func ExtractTokenID ¶
ExtractTokenID : extract user id info from jwt token
Types ¶
type Config ¶
type Config struct { SocialCallbackBaseURL string ServerPort string CookieStore string JwtTokenSecret string TwitterKey string TwitterSecret string FacebookKey string FacebookSecret string FitbitKey string FitbitSecret string GoogleKey string GoogleSecret string GplusKey string GplusSecret string GithubKey string GithubSecret string SpotifyKey string SpotifySecret string LinkedinKey string LinkedinSecret string LineKey string LineSecret string LastfmKey string LastfmSecret string TwitchKey string TwitchSecret string DropboxKey string DropboxSecret string DigitaloceanKey string DigitaloceanSecret string BitbucketKey string BitbucketSecret string InstagramKey string InstagramSecret string IntercomKey string IntercomSecret string BoxKey string BoxSecret string SalesforceKey string SalesforceSecret string SeatalkKey string SeatalkSecret string AmazonKey string AmazonSecret string YammerKey string YammerSecret string OnedriveKey string OnedriveSecret string AzureadKey string AzureadSecret string MicrosoftonlineKey string MicrosoftonlineSecret string BattlenetKey string BattlenetSecret string EveonlineKey string EveonlineSecret string KakaoKey string KakaoSecret string YahooKey string YahooSecret string TypetalkKey string TypetalkSecret string SlackKey string SlackSecret string StripeKey string StripeSecret string WepayKey string WepaySecret string PaypalKey string PaypalSecret string SteamKey string HerokuKey string HerokuSecret string UberKey string UberSecret string SoundcloudKey string SoundcloudSecret string GitlabKey string GitlabSecret string DailymotionKey string DailymotionSecret string DeezerKey string DeezerSecret string DiscordKey string DiscordSecret string MeetupKey string MeetupSecret string Auth0Key string Auth0Secret string Auth0Domain string XeroKey string XeroSecret string VkKey string VkSecret string YandexKey string YandexSecret string NextcloudKey string NextcloudSecret string NextcloudURL string GiteaKey string GiteaSecret string ShopifyKey string ShopifySecret string AppleKey string AppleSecret string StravaKey string StravaSecret string OpenidConnectKey string OpenidConnectSecret string OpenidConnectDiscoveryURL string DB Database `toml:"Database"` }
Config : configurations settings
type User ¶
type User struct { gorm.Model Provider string Email string `gorm:"type:varchar(100);unique_index"` Name string FirstName string LastName string NickName string Description string UserID string AvatarURL string Location string AccessToken string AccessTokenSecret string RefreshToken string ExpiresAt time.Time IDToken string }
User : user info to database
func (*User) DeleteUserByID ¶
DeleteUserByID : find the user by id and delete it
func (*User) FindAllUsers ¶
FindAllUsers : find the user by id and delete it
func (*User) FindUserByEMail ¶
FindUserByEMail : find the user by email
func (*User) FindUserByID ¶
FindUserByID : find the user by id
func (*User) FromGothUser ¶
FromGothUser : trasforming from goth user to this model
Click to show internal directories.
Click to hide internal directories.