user

package
v0.2.15 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 28, 2025 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ValidateCodeAttempts = 10
	DefaultLocale        = types.Locale("es-MX")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type User

type User struct {
	bun.BaseModel `bun:"table:users"`

	ID           int64        `bun:",pk,autoincrement" json:"id"`
	Name         string       `json:"name"`
	LastName     string       `json:"last_name"`
	Email        string       `json:"email"`
	PhoneNumber  string       `json:"phone_number"`
	Locale       types.Locale `json:"locale"`
	CodeAttempts int          `json:"-"`
}

func NewUser

func NewUser(name, lastName, email, phoneNumber, countryCode string) (*User, error)

func (*User) Delete

func (u *User) Delete(ctx context.Context, db bun.IDB) error

Delete removes a user from the database

func (*User) FullName

func (user *User) FullName() string

func (User) GetCursor

func (u User) GetCursor() string

Implement the Paginatable interface

func (User) GetSortField

func (u User) GetSortField() string

func (User) GetSortValue

func (u User) GetSortValue() interface{}

func (User) GetUniqueField

func (u User) GetUniqueField() string

func (User) GetUniqueValue

func (u User) GetUniqueValue() interface{}

func (*User) HasEmail

func (user *User) HasEmail() bool

func (*User) HasPhoneNumber

func (user *User) HasPhoneNumber() bool

func (*User) Insert

func (u *User) Insert(ctx context.Context, db bun.IDB) error

func (*User) Update

func (u *User) Update(ctx context.Context, db bun.IDB) error

Update updates an existing user

func (*User) UpdateLocale

func (user *User) UpdateLocale(locale string) error

func (*User) Validate

func (u *User) Validate() error

Implement the Model interface

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL