Documentation ¶
Overview ¶
Package model contains the types for schema 'go_echo_api_boilerplate_development'.
Package model contains the types for schema 'go_echo_api_boilerplate_development'.
Package model contains the types for schema 'go_echo_api_boilerplate_development'.
Package model contains the types for schema 'go_echo_api_boilerplate_development'.
Index ¶
- Constants
- Variables
- func Ping(db Queryer) error
- type Execer
- type Executor
- type Gender
- type Queryer
- type ScannerValuer
- type Slice
- type SmsReconfirmation
- func GetSmsReconfirmation(ctx context.Context, db Queryer, key uint64) (*SmsReconfirmation, error)
- func NewSMSReconfirmation(userId uint64, phoneNumber string) *SmsReconfirmation
- func SmsReconfirmationByID(ctx context.Context, db Queryer, id uint64) (*SmsReconfirmation, error)
- func SmsReconfirmationByPhoneNumber(ctx context.Context, db Queryer, phoneNumber string) (*SmsReconfirmation, error)
- func SmsReconfirmationByUserID(ctx context.Context, db Queryer, userID uint64) (*SmsReconfirmation, error)
- func (sr *SmsReconfirmation) Delete(ctx context.Context, db Execer) error
- func (sr *SmsReconfirmation) Deleted() bool
- func (sr *SmsReconfirmation) Exists() bool
- func (sr *SmsReconfirmation) Insert(ctx context.Context, db Execer) error
- func (sr *SmsReconfirmation) IsExpired() bool
- func (sr *SmsReconfirmation) Save(ctx context.Context, db Execer) error
- func (sr *SmsReconfirmation) Update(ctx context.Context, db Execer) error
- func (sr *SmsReconfirmation) User(ctx context.Context, db Executor) (*User, error)
- type StringSlice
- type TempUser
- func GetTempUser(ctx context.Context, db Queryer, key uint64) (*TempUser, error)
- func NewTempUser(phoneNumber string) *TempUser
- func TempUserByAuthCodeAuthKey(ctx context.Context, db Queryer, authCode string, authKey string) (*TempUser, error)
- func TempUserByID(ctx context.Context, db Queryer, id uint64) (*TempUser, error)
- func TempUserByPhoneNumber(ctx context.Context, db Queryer, phoneNumber string) (*TempUser, error)
- func (tu *TempUser) Delete(ctx context.Context, db Execer) error
- func (tu *TempUser) Deleted() bool
- func (tu *TempUser) Exists() bool
- func (tu *TempUser) Insert(ctx context.Context, db Execer) error
- func (tu *TempUser) IsExpired() bool
- func (tu *TempUser) Save(ctx context.Context, db Execer) error
- func (tu *TempUser) Update(ctx context.Context, db Execer) error
- func (tu *TempUser) ValidateAuthInfo(authCode string, authKey string) bool
- type User
- func GetUser(ctx context.Context, db Queryer, key uint64) (*User, error)
- func NewUser(phoneNumber, email, password, firstName, lastName string, gender Gender, ...) *User
- func UserByEmail(ctx context.Context, db Queryer, email string) (*User, error)
- func UserByID(ctx context.Context, db Queryer, id uint64) (*User, error)
- func UserByPhoneNumber(ctx context.Context, db Queryer, phoneNumber string) (*User, error)
- func (u *User) ConfirmPhoneNumber() error
- func (u *User) Delete(ctx context.Context, db Execer) error
- func (u *User) Deleted() bool
- func (u *User) Exists() bool
- func (u *User) GenderString() string
- func (u *User) Insert(ctx context.Context, db Execer) error
- func (u *User) SMSReconfirmation(ctx context.Context, db Queryer) (*SmsReconfirmation, error)
- func (u *User) Save(ctx context.Context, db Execer) error
- func (u *User) Update(ctx context.Context, db Execer) error
Constants ¶
const ( // Exec operation for like sql.DB.Exec() Exec operation = 1 // Query operation for sql.DB.Query() Query operation = 2 )
Variables ¶
var XOLog = func(context.Context, string, ...interface{}) {}
XOLog provides the log func used by generated queries.
Functions ¶
Types ¶
type Executor ¶
Executor is the common interface for database operations that can be used with types from schema 'go_echo_api_boilerplate_development'.
This should work with database/sql.DB and database/sql.Tx.
type ScannerValuer ¶
ScannerValuer is the common interface for types that implement both the database/sql.Scanner and sql/driver.Valuer interfaces.
type SmsReconfirmation ¶
type SmsReconfirmation struct { ID uint64 `json:"id" db:"id"` // id UserID uint64 `json:"user_id" db:"user_id"` // user_id PhoneNumber string `json:"phone_number" db:"phone_number"` // phone_number AuthCode string `json:"auth_code" db:"auth_code"` // auth_code CreatedAt time.Time `json:"created_at" db:"created_at"` // created_at UpdatedAt time.Time `json:"updated_at" db:"updated_at"` // updated_at // contains filtered or unexported fields }
SmsReconfirmation represents a row from 'sms_reconfirmations'.
func GetSmsReconfirmation ¶
GetSmsReconfirmation gets a SmsReconfirmation by primary key
func NewSMSReconfirmation ¶
func NewSMSReconfirmation(userId uint64, phoneNumber string) *SmsReconfirmation
NewSMSConfirmation returns initialized sms reconfirmation
func SmsReconfirmationByID ¶
SmsReconfirmationByID retrieves a row from 'sms_reconfirmations' as a SmsReconfirmation.
Generated from index 'sms_reconfirmations_id_pkey'.
func SmsReconfirmationByPhoneNumber ¶
func SmsReconfirmationByPhoneNumber(ctx context.Context, db Queryer, phoneNumber string) (*SmsReconfirmation, error)
SmsReconfirmationByPhoneNumber retrieves a row from 'sms_reconfirmations' as a SmsReconfirmation.
Generated from index 'phone_number'.
func SmsReconfirmationByUserID ¶
func SmsReconfirmationByUserID(ctx context.Context, db Queryer, userID uint64) (*SmsReconfirmation, error)
SmsReconfirmationByUserID retrieves a row from 'sms_reconfirmations' as a SmsReconfirmation.
Generated from index 'user_id'.
func (*SmsReconfirmation) Delete ¶
func (sr *SmsReconfirmation) Delete(ctx context.Context, db Execer) error
Delete deletes the SmsReconfirmation from the database.
func (*SmsReconfirmation) Deleted ¶
func (sr *SmsReconfirmation) Deleted() bool
Deleted provides information if the SmsReconfirmation has been deleted from the database.
func (*SmsReconfirmation) Exists ¶
func (sr *SmsReconfirmation) Exists() bool
Exists determines if the SmsReconfirmation exists in the database.
func (*SmsReconfirmation) Insert ¶
func (sr *SmsReconfirmation) Insert(ctx context.Context, db Execer) error
Insert inserts the SmsReconfirmation to the database.
func (*SmsReconfirmation) IsExpired ¶
func (sr *SmsReconfirmation) IsExpired() bool
IsExpired checks if the sms reconfirmation is expired (specified hours have passed)
func (*SmsReconfirmation) Save ¶
func (sr *SmsReconfirmation) Save(ctx context.Context, db Execer) error
Save saves the SmsReconfirmation to the database.
type StringSlice ¶
type StringSlice []string
StringSlice is a slice of strings.
func (*StringSlice) Scan ¶
func (ss *StringSlice) Scan(src interface{}) error
Scan satisfies the sql.Scanner interface for StringSlice.
type TempUser ¶
type TempUser struct { ID uint64 `json:"id" db:"id"` // id PhoneNumber string `json:"phone_number" db:"phone_number"` // phone_number AuthCode string `json:"auth_code" db:"auth_code"` // auth_code AuthKey string `json:"auth_key" db:"auth_key"` // auth_key CreatedAt time.Time `json:"created_at" db:"created_at"` // created_at UpdatedAt time.Time `json:"updated_at" db:"updated_at"` // updated_at // contains filtered or unexported fields }
TempUser represents a row from 'temp_users'.
func GetTempUser ¶
GetTempUser gets a TempUser by primary key
func NewTempUser ¶
NewTempUser returns initialized temp user
func TempUserByAuthCodeAuthKey ¶
func TempUserByAuthCodeAuthKey(ctx context.Context, db Queryer, authCode string, authKey string) (*TempUser, error)
TempUserByAuthCodeAuthKey retrieves a row from 'temp_users' as a TempUser.
Generated from index 'auth_code_auth_key_idx'.
func TempUserByID ¶
TempUserByID retrieves a row from 'temp_users' as a TempUser.
Generated from index 'temp_users_id_pkey'.
func TempUserByPhoneNumber ¶
TempUserByPhoneNumber retrieves a row from 'temp_users' as a TempUser.
Generated from index 'phone_number'.
func (*TempUser) Deleted ¶
Deleted provides information if the TempUser has been deleted from the database.
func (*TempUser) IsExpired ¶
IsExpired checks if the temp user confirmation is expired (specified hours have passed)
type User ¶
type User struct { ID uint64 `json:"id" db:"id"` // id FirstName string `json:"first_name" db:"first_name"` // first_name LastName string `json:"last_name" db:"last_name"` // last_name Gender int64 `json:"gender" db:"gender"` // gender DateOfBirth mysql.NullTime `json:"date_of_birth" db:"date_of_birth"` // date_of_birth PhoneNumber string `json:"phone_number" db:"phone_number"` // phone_number UnconfirmedPhoneNumber sql.NullString `json:"unconfirmed_phone_number" db:"unconfirmed_phone_number"` // unconfirmed_phone_number Email string `json:"email" db:"email"` // email PasswordDigest []byte `json:"password_digest" db:"password_digest"` // password_digest CreatedAt time.Time `json:"created_at" db:"created_at"` // created_at UpdatedAt time.Time `json:"updated_at" db:"updated_at"` // updated_at // contains filtered or unexported fields }
User represents a row from 'users'.
func NewUser ¶
func NewUser(phoneNumber, email, password, firstName, lastName string, gender Gender, dateOfBirth null.Time) *User
NewUser returns initialized user
func UserByEmail ¶
UserByEmail retrieves a row from 'users' as a User.
Generated from index 'email'.
func UserByID ¶
UserByID retrieves a row from 'users' as a User.
Generated from index 'users_id_pkey'.
func UserByPhoneNumber ¶
UserByPhoneNumber retrieves a row from 'users' as a User.
Generated from index 'phone_number'.
func (*User) ConfirmPhoneNumber ¶
func (*User) SMSReconfirmation ¶
SMSReconfirmation returns the SMSReconfirmation associated with the User's ID (id).