Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthResponse ¶
AuthResponse model
type AuthToken ¶
type AuthToken struct { AccessToken string `json:"accessToken"` ExpiredAt time.Time `json:"expiredAt"` }
AuthToken model
type Repo ¶
type Repo struct {
DB *pg.DB
}
Repo contains all User related functions
func (*Repo) GetUserByID ¶
GetUserByID gets user by id
func (*Repo) LoginUser ¶
func (ur *Repo) LoginUser(input model.LoginInput) (*AuthResponse, error)
LoginUser logs in a user
func (*Repo) RegisterUser ¶
func (ur *Repo) RegisterUser(input model.RegisterInput) (*AuthResponse, error)
RegisterUser registers users
type User ¶
type User struct { ID string `json:"id" pg:"type:uuid,unique,default:gen_random_uuid()"` Email string `json:"email" pg:",unique,notnull"` Password string `json:"password" pg:",notnull"` FirstName string `json:"firstName" pg:",notnull"` LastName *string `json:"lastName"` CreatedAt time.Time `json:"createdAt" pg:"type:timestamp,notnull"` }
User model
Click to show internal directories.
Click to hide internal directories.