entity

package
v0.0.0-...-dab1d25 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ShortURL

type ShortURL struct {
	Id          uuid.UUID `json:"id" db:"id"`
	OriginalURL string    `json:"original_url,omitempty" db:"original_url" validate:"http_url"`
	ShortCode   string    `json:"short_code,omitempty" db:"short_code" validate:"lte=16"`
	CreatedAt   time.Time `json:"created_at,omitempty" db:"created_at"`
	UpdatedAt   time.Time `json:"updated_at,omitempty" db:"updated_at"`
}

type User

type User struct {
	UserId    uuid.UUID `json:"user_id,omitempty" db:"user_id" redis:"user_id"`
	Username  string    `json:"username,omitempty" db:"username" redis:"username"`
	Email     string    `json:"email,omitempty" db:"email" redis:"email"`
	Password  string    `json:"password,omitempty" db:"hashed_password"`
	CreatedAt time.Time `json:"created_at,omitempty" db:"created_at" redis:"created_at"`
	UpdatedAt time.Time `json:"updated_at,omitempty" db:"updated_at" redis:"updated_at"`
}

func (*User) ComparePassword

func (u *User) ComparePassword(password string) error

func (*User) HashPassword

func (u *User) HashPassword() error

func (*User) SanitizePassword

func (u *User) SanitizePassword()

func (*User) TableName

func (u *User) TableName() string

func (*User) UnmarshalBinary

func (u *User) UnmarshalBinary(b []byte) error

UnmarshalBinary implements the encoding.BinaryUnmarshaler interface for decoding a User object from redis.

type UserWithToken

type UserWithToken struct {
	*User `json:"user"`
	Token string `json:"jwt_token"`
}

Jump to

Keyboard shortcuts

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