Documentation ¶
Index ¶
- func DoesUserExist(ctx context.Context, Q *db.Queries, email string) (bool, error)
- func GetUserByEmail(ctx context.Context, Q *db.Queries, email string) (*db.User, error)
- func NewUser(ctx context.Context, Q *db.Queries, email string, password string, ...) (*db.User, error)
- type AccessTokenResponse
- type AccountContact
- type AccountInfo
- type AppUser
- type ConfirmEmailInfo
- type ConfirmEmailResponse
- type EmailUpdateInfo
- type MyJWTClaims
- type PasswordLoginParams
- type ResetPasswordInfo
- type SignupParams
- type UserAccountResponse
- type UserInfo
- type UserService
- func (usvc *UserService) AdminLoginAs(ctx context.Context, email string) (*AccessTokenResponse, error)
- func (usvc *UserService) AuthenticateExternalUser(ctx context.Context, userInfo *external.UserProvidedData) (*AccessTokenResponse, error)
- func (usvc *UserService) CompleteEmailUpdate(ctx context.Context, token string) error
- func (usvc *UserService) ConfirmUserEmail(ctx context.Context, code string) (*ConfirmEmailResponse, error)
- func (usvc *UserService) DeleteAPIKey(ctx context.Context, apiKey string, userID string) error
- func (usvc *UserService) GetAPIKeys(ctx context.Context, userID string) ([]db.GetAPIKeysRow, error)
- func (usvc *UserService) GetUser(ctx context.Context, strID string) (*db.User, error)
- func (usvc *UserService) GetUserFromAPIKey(ctx context.Context, apiKey string) (*db.User, error)
- func (usvc *UserService) GetUserIDFromAPIKey(apiKey string) (string, error)
- func (usvc *UserService) GetUsersCreatedNDaysAgo(ctx context.Context, days int32) ([]db.GetUsersSignedUpNDaysAgoRow, error)
- func (usvc *UserService) InitResetPasswordRequest(ctx context.Context, email string) error
- func (usvc *UserService) NewAPIKey(ctx context.Context, userID string) (string, error)
- func (usvc *UserService) PasswordLogin(ctx context.Context, params *PasswordLoginParams) (*AccessTokenResponse, error)
- func (usvc *UserService) PostConfirmationEmail(userID string)
- func (usvc *UserService) PostEmailUpdateConfirmation(userID string, email string)
- func (usvc *UserService) PostPasswordResetEmail(email string)
- func (usvc *UserService) RenewRefreshToken(ctx context.Context, current_token string) (*AccessTokenResponse, error)
- func (usvc *UserService) ResetPassword(ctx context.Context, token string, passwd string) error
- func (usvc *UserService) SendEmailConfirmationRequest(ctx context.Context, userID string) error
- func (usvc *UserService) Shutdown()
- func (this *UserService) SignupNewUser(ctx context.Context, params *SignupParams) (*db.User, error)
- func (usvc *UserService) SwitchToFreeAccount(ctx context.Context, email string) (*UserAccountResponse, error)
- func (usvc *UserService) UpdateAppUser(ctx context.Context, userID string, appUser *AppUser, ...) error
- func (usvc *UserService) UpdatePassword(ctx context.Context, user *db.User, oldPassword string, newPassword string) error
- func (usvc *UserService) UpdateProfileField(ctx context.Context, user *db.User, fieldName string, fieldValue string) error
- func (usvc *UserService) UpdateUserAccount(ctx context.Context, email string, appUser *AppUser) (*UserAccountResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DoesUserExist ¶
func GetUserByEmail ¶
Types ¶
type AccessTokenResponse ¶
type AccessTokenResponse struct { Token string `json:"access_token"` TokenType string `json:"token_type"` // Bearer ExpiresIn int `json:"expires_in"` RefreshToken string `json:"refresh_token"` }
AccessTokenResponse represents an OAuth2 success response
type AccountContact ¶
type AccountInfo ¶
type AccountInfo struct { ID string `json:"id"` Contact AccountContact `json:"contact"` Language string `json:"language"` Country string `json:"country"` }
type AppUser ¶
type AppUser struct { UserType string `json:"user_type"` Updated time.Time `json:"updated"` Reseller string `json:"reseller"` AccountInfo AccountInfo `json:"account_info"` }
type ConfirmEmailInfo ¶
type ConfirmEmailResponse ¶
type EmailUpdateInfo ¶
type MyJWTClaims ¶
type MyJWTClaims struct { jwt.StandardClaims Email string `json:"email"` AppMetaData map[string]interface{} `json:"app_metadata"` UserMetaData map[string]interface{} `json:"user_metadata"` }
TODO: Remove unnecessary data from JWT token (such as Email) Holds JWT claims
type PasswordLoginParams ¶
type ResetPasswordInfo ¶
type SignupParams ¶
type SignupParams struct { Email string `json:"email"` Password string `json:"password"` Data map[string]interface{} `json:"data"` Provider string `json:"-"` }
SignupParams are the parameters the Signup endpoint accepts
type UserAccountResponse ¶
type UserAccountResponse struct {
UserID string `json:"user_id"`
}
type UserService ¶
type UserService struct {
// contains filtered or unexported fields
}
func New ¶
func New(svc *service.Service) *UserService
func (*UserService) AdminLoginAs ¶
func (usvc *UserService) AdminLoginAs(ctx context.Context, email string) (*AccessTokenResponse, error)
func (*UserService) AuthenticateExternalUser ¶
func (usvc *UserService) AuthenticateExternalUser(ctx context.Context, userInfo *external.UserProvidedData) (*AccessTokenResponse, error)
func (*UserService) CompleteEmailUpdate ¶
func (usvc *UserService) CompleteEmailUpdate(ctx context.Context, token string) error
func (*UserService) ConfirmUserEmail ¶
func (usvc *UserService) ConfirmUserEmail(ctx context.Context, code string) (*ConfirmEmailResponse, error)
func (*UserService) DeleteAPIKey ¶
func (*UserService) GetAPIKeys ¶
func (usvc *UserService) GetAPIKeys(ctx context.Context, userID string) ([]db.GetAPIKeysRow, error)
func (*UserService) GetUserFromAPIKey ¶
func (*UserService) GetUserIDFromAPIKey ¶
func (usvc *UserService) GetUserIDFromAPIKey(apiKey string) (string, error)
func (*UserService) GetUsersCreatedNDaysAgo ¶
func (usvc *UserService) GetUsersCreatedNDaysAgo(ctx context.Context, days int32) ([]db.GetUsersSignedUpNDaysAgoRow, error)
func (*UserService) InitResetPasswordRequest ¶
func (usvc *UserService) InitResetPasswordRequest(ctx context.Context, email string) error
func (*UserService) PasswordLogin ¶
func (usvc *UserService) PasswordLogin(ctx context.Context, params *PasswordLoginParams) (*AccessTokenResponse, error)
func (*UserService) PostConfirmationEmail ¶
func (usvc *UserService) PostConfirmationEmail(userID string)
func (*UserService) PostEmailUpdateConfirmation ¶
func (usvc *UserService) PostEmailUpdateConfirmation(userID string, email string)
func (*UserService) PostPasswordResetEmail ¶
func (usvc *UserService) PostPasswordResetEmail(email string)
func (*UserService) RenewRefreshToken ¶
func (usvc *UserService) RenewRefreshToken(ctx context.Context, current_token string) (*AccessTokenResponse, error)
func (*UserService) ResetPassword ¶
func (*UserService) SendEmailConfirmationRequest ¶
func (usvc *UserService) SendEmailConfirmationRequest(ctx context.Context, userID string) error
func (*UserService) Shutdown ¶
func (usvc *UserService) Shutdown()
func (*UserService) SignupNewUser ¶
func (this *UserService) SignupNewUser(ctx context.Context, params *SignupParams) (*db.User, error)
func (*UserService) SwitchToFreeAccount ¶
func (usvc *UserService) SwitchToFreeAccount(ctx context.Context, email string) (*UserAccountResponse, error)
func (*UserService) UpdateAppUser ¶
func (*UserService) UpdatePassword ¶
func (*UserService) UpdateProfileField ¶
func (*UserService) UpdateUserAccount ¶
func (usvc *UserService) UpdateUserAccount(ctx context.Context, email string, appUser *AppUser) (*UserAccountResponse, error)
Click to show internal directories.
Click to hide internal directories.