model

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2025 License: MPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type UserModel

type UserModel struct {
	gorm.Model
	Name           string     `gorm:"type:varchar(100);not null"             json:"name"`
	Email          string     `gorm:"type:varchar(255);uniqueIndex;not null" json:"email"`
	HashedPassword *string    `gorm:"column:hashed_password"                 json:"-"`
	GithubID       *string    `gorm:"column:github_id;unique"                json:"github_id"`
	LastLoginAt    *time.Time `                                              json:"last_login_at"`
	Role           UserRole   `gorm:"type:varchar(20);default:'user'"        json:"role"`
}

func (UserModel) TableName

func (UserModel) TableName() string

func (*UserModel) ToPb

func (u *UserModel) ToPb() *userpb.User

func (*UserModel) UpdateFromPb

func (u *UserModel) UpdateFromPb(req *userpb.UpdateUserRequest)

type UserRole

type UserRole string
const (
	UserRoleUser  UserRole = "user"
	UserRoleAdmin UserRole = "admin"
)

func (*UserRole) FromPb

func (role *UserRole) FromPb(pbRole userpb.UserRole)

func (UserRole) ToPb

func (role UserRole) ToPb() userpb.UserRole

Jump to

Keyboard shortcuts

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