Documentation ¶
Index ¶
- Variables
- type ErrorResponse
- type GoogleUseCase
- type GoogleUser
- type JwtCustomClaims
- type JwtCustomRefreshClaims
- type LoginRequest
- type LoginResponse
- type LoginUseCase
- type RefreshTokenRequest
- type RefreshTokenResponse
- type RefreshTokenUseCase
- type SignupRequest
- type SignupResponse
- type SignupUseCase
- type User
- type UserResponse
- type UserUseCase
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrUserNotAllowed = errors.New("user not allowed") ErrUserNotFound = errors.New("user not found") ErrInvalidPassword = errors.New("invalid password") ErrUserShouldLoginWithGoogle = errors.New("user should login with Google") ErrCodeExchangeWrong = errors.New("code exchange wrong") ErrFailedGetGoogleUser = errors.New("failed to get google user") ErrFailedToReadResponse = errors.New("failed to read response") ErrUnexpectedSigningMethod = errors.New("unexpected signing method") ErrInvalidToken = errors.New("invalid token") )
Error List:
Functions ¶
This section is empty.
Types ¶
type ErrorResponse ¶
type ErrorResponse struct {
Message string `json:"message"`
}
type GoogleUseCase ¶
type GoogleUseCase interface { GoogleLogin(ctx context.Context, data []byte, env *bootstrap.Env) (accessToken string, refreshToken string, err error) GetUserDataFromGoogle(googleOauthConfig *oauth2.Config, code, oauthGoogleUrlAPI string) ([]byte, error) GenerateStateOauthCookie(w http.ResponseWriter) string }
type GoogleUser ¶
type JwtCustomClaims ¶
type JwtCustomRefreshClaims ¶
type LoginRequest ¶
type LoginResponse ¶
type LoginUseCase ¶
type RefreshTokenRequest ¶
type RefreshTokenRequest struct {
RefreshToken string `form:"refreshToken" binding:"required"`
}
type RefreshTokenResponse ¶
type RefreshTokenUseCase ¶
type SignupRequest ¶
type SignupResponse ¶
type SignupUseCase ¶
type User ¶
type User struct { Id int `json:"id" db:"id"` GoogleId string `json:"google_id" db:"google_id"` ProfilePicture string `json:"profile_picture" db:"profile_picture"` Name string `json:"name" db:"name"` Password string `json:"password" db:"password"` Email string `json:"email" db:"email"` Phone string `json:"phone" db:"phone"` CreatedAt time.Time `json:"created_at" db:"created_at"` UpdatedAt time.Time `json:"updated_at" db:"updated_at"` }
type UserResponse ¶
type UserResponse struct { Id int `json:"id" db:"id"` GoogleId string `json:"google_id" db:"google_id"` ProfilePicture string `json:"profile_picture" db:"profile_picture"` Name string `json:"name" db:"name"` Email string `json:"email" db:"email"` Phone string `json:"phone" db:"phone"` CreatedAt time.Time `json:"created_at" db:"created_at"` }
Click to show internal directories.
Click to hide internal directories.