Documentation ¶
Index ¶
- Constants
- type Repository
- func (r *Repository) CreateUserWithEmail(email, userType string) (User, error)
- func (r *Repository) DeleteExpiredUserSignOnTokens() error
- func (r *Repository) DeleteUserByEmail(email string) error
- func (r *Repository) GetOrCreateUserFromToken(token string) (User, bool, error)
- func (r *Repository) GetUserTypeByEmail(email string) (string, error)
- func (r *Repository) GetUserTypeByEmailOrCreateUserIfRecruiter(email string, jobRepo *job.Repository, recRepo *recruiter.Repository) (string, error)
- func (r *Repository) SaveTokenSignOn(email, token, userType string) error
- type User
Constants ¶
View Source
const ( UserTypeDeveloper = "developer" UserTypeAdmin = "admin" UserTypeRecruiter = "recruiter" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
func NewRepository ¶
func NewRepository(db *sql.DB) *Repository
func (*Repository) CreateUserWithEmail ¶
func (r *Repository) CreateUserWithEmail(email, userType string) (User, error)
CreateUserWithEmail creates a new user with given email and user_type returns the user struct, and an error
func (*Repository) DeleteExpiredUserSignOnTokens ¶
func (r *Repository) DeleteExpiredUserSignOnTokens() error
DeleteExpiredUserSignOnTokens deletes user_sign_on_tokens older than 1 week
func (*Repository) DeleteUserByEmail ¶
func (r *Repository) DeleteUserByEmail(email string) error
func (*Repository) GetOrCreateUserFromToken ¶
func (r *Repository) GetOrCreateUserFromToken(token string) (User, bool, error)
GetOrCreateUserFromToken creates or get existing user given a token returns the user struct, whether the user existed already and an error
func (*Repository) GetUserTypeByEmail ¶
func (r *Repository) GetUserTypeByEmail(email string) (string, error)
func (*Repository) GetUserTypeByEmailOrCreateUserIfRecruiter ¶
func (r *Repository) GetUserTypeByEmailOrCreateUserIfRecruiter(email string, jobRepo *job.Repository, recRepo *recruiter.Repository) (string, error)
GetUserTypeByEmailOrCreateUserIfRecruiter seeks a user in the users table or creates one and recruiter profile if the user has a job posting returns user struct and an error
func (*Repository) SaveTokenSignOn ¶
func (r *Repository) SaveTokenSignOn(email, token, userType string) error
Click to show internal directories.
Click to hide internal directories.