models

package
v1.4.8 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type User

type User struct {
	ID         uuid.UUID `db:"id" json:"id" validate:"required,id"`
	CreatedAt  time.Time `db:"created_at" json:"created_at"`
	UpdatedAt  time.Time `db:"updated_at" json:"updated_at"`
	Email      string    `db:"email" json:"email" validate:"required,email"`
	UserStatus int       `db:"user_status" json:"user_status"`
	UserAttrs  UserAttrs `db:"user_attrs" json:"user_attrs"`
}

User struct describe user object.

type UserAttrs

type UserAttrs struct {
	Picture   string `json:"picture"`
	FirstName string `json:"first_name"`
	LastName  string `json:"last_name"`
	About     string `json:"about"`
}

UserAttrs struct describe user attributes.

func (*UserAttrs) Scan

func (u *UserAttrs) Scan(value interface{}) error

Scan make the UserAttrs struct implement the sql.Scanner interface. This method simply decodes a JSON-encoded value into the struct fields.

func (UserAttrs) Value

func (u UserAttrs) Value() (driver.Value, error)

Value make the UserAttrs struct implement the driver.Valuer interface. This method simply returns the JSON-encoded representation of the struct.

Jump to

Keyboard shortcuts

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