user

package
v0.0.0-...-1ae8f5d Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Auth

func Auth(c *fiber.Ctx) error

func GoogleOauth

func GoogleOauth(c *fiber.Ctx) error

func Login

func Login(c *fiber.Ctx) error

func NewUser

func NewUser(c *fiber.Ctx) error

func Setup

func Setup()

func TwitterOauth10RequestToken

func TwitterOauth10RequestToken(c *fiber.Ctx) error

func TwitterOauth20Token

func TwitterOauth20Token(c *fiber.Ctx)

func UpdateGoogleUserInfo

func UpdateGoogleUserInfo(u *User, claims map[string]interface{}) error

Types

type GoogleGetGoogleUserInfoByIDTokenResponse

type GoogleGetGoogleUserInfoByIDTokenResponse struct {
	Status string                 `json:"status"`
	Value  map[string]interface{} `json:"value"`
}

type GoogleOauthRequest

type GoogleOauthRequest struct {
	IDToken string `json:"id_token"`
}

type TwitterOauth10RequestTokenRequest

type TwitterOauth10RequestTokenRequest struct {
	OauthCallback   string `json:"oauth_callback"`
	XAuthAccessType string `json:"x_auth_access_type"`
}

type TwitterOauth10RequestTokenResponse

type TwitterOauth10RequestTokenResponse struct {
	Status string                 `json:"status"`
	Value  map[string]interface{} `json:"value"`
}

type User

type User struct {
	gorm.Model
	Account          string      `gorm:"size:255; unique"`
	Password         string      `gorm:"size:255" json:"password"`
	UserProfile      UserProfile `json:"profile"`
	UserBindProvider []UserBindProvider
}

func GetUserByJwtToken

func GetUserByJwtToken(c *fiber.Ctx) *User

func GetUserByProvider

func GetUserByProvider(provider string, providerUniqueID string) (*User, error)

func NewOauthUser

func NewOauthUser(provider string, uniqueID string) (*User, error)

type UserBindProvider

type UserBindProvider struct {
	gorm.Model
	Provider         string
	UserID           uint
	ProviderUniqueID string
}

type UserProfile

type UserProfile struct {
	gorm.Model
	UserID uint    `json:"user_id"`
	Email  *string `json:"email" validate:"email"`
}

Jump to

Keyboard shortcuts

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