users

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdminUser

type AdminUser struct {
	UserUUID string `gorm:"type:char(36);not null;primaryKey"`
	Email    string `gorm:"type:varchar(255);not null;unique"`
	Name     string `gorm:"type:varchar(32);not null;unique"`
}

func (*AdminUser) GetEmail

func (u *AdminUser) GetEmail() string

func (*AdminUser) GetName

func (u *AdminUser) GetName() string

func (*AdminUser) GetRole

func (u *AdminUser) GetRole() consts.UserType

func (*AdminUser) GetUserID

func (u *AdminUser) GetUserID() string

func (*AdminUser) ToUserResponse

func (u *AdminUser) ToUserResponse() *UserResponse

type DomainUser

type DomainUser struct {
	UserUUID  string         `gorm:"type:char(36);not null;primaryKey"`
	Email     string         `gorm:"type:varchar(255);not null;unique"`
	Name      string         `gorm:"type:varchar(32);not null;unique"`
	Favorites []FavoriteClub `gorm:"foreignKey:UserUUID;references:UserUUID"`
}

func (*DomainUser) GetEmail

func (u *DomainUser) GetEmail() string

func (*DomainUser) GetName

func (u *DomainUser) GetName() string

func (*DomainUser) GetRole

func (u *DomainUser) GetRole() consts.UserType

func (*DomainUser) GetUserID

func (u *DomainUser) GetUserID() string

func (*DomainUser) ToUserResponse

func (u *DomainUser) ToUserResponse() *UserResponse

type FavoriteClub

type FavoriteClub struct {
	UserUUID string `gorm:"type:char(36);not null;primaryKey"`
	ClubUUID string `gorm:"type:char(36);not null;primaryKey"`
}

type GeneralUser

type GeneralUser struct {
	UserUUID string         `gorm:"type:char(36);not null;primaryKey"`
	Email    string         `gorm:"type:varchar(255);not null;unique"`
	Name     string         `gorm:"type:varchar(32);not null;unique"`
	ClubUUID sql.NullString `gorm:"foreignKey:ClubUUID;references:ClubUUID"`
}

func (*GeneralUser) GetEmail

func (u *GeneralUser) GetEmail() string

func (*GeneralUser) GetName

func (u *GeneralUser) GetName() string

func (*GeneralUser) GetRole

func (u *GeneralUser) GetRole() consts.UserType

func (*GeneralUser) GetUserID

func (u *GeneralUser) GetUserID() string

func (*GeneralUser) ToUserResponse

func (u *GeneralUser) ToUserResponse() *UserResponse

type GeneralUserSlice

type GeneralUserSlice []GeneralUser

func (GeneralUserSlice) GetEmails

func (g GeneralUserSlice) GetEmails() []string

type ImageResponse

type ImageResponse struct {
	ImageID uint32 `json:"image_id"`
	Path    string `json:"path"`
}

type Images

type Images []UploadedImage

func (Images) ToImageResponse

func (im Images) ToImageResponse() []ImageResponse

type ThumbnailResponse

type ThumbnailResponse struct {
	ThumbnailID uint32 `json:"thumbnail_id"`
	Path        string `json:"path"`
}

type UploadedImage

type UploadedImage struct {
	ImageID   uint32 `gorm:"type:int unsigned not null auto_increment;primaryKey"`
	Owner     string `gorm:"type:char(36);not null;primaryKey"`
	Path      string `gorm:"type:varchar(255);not null;unique"`
	CreatedAt time.Time
}

type UploadedThumbnail

type UploadedThumbnail struct {
	ThumbnailID uint32 `gorm:"type:int unsigned not null auto_increment;primaryKey"`
	Path        string `gorm:"type:varchar(255);not null;unique"`
}

func (*UploadedThumbnail) ToThumbnailResponse

func (ut *UploadedThumbnail) ToThumbnailResponse() ThumbnailResponse

type User

type User struct {
	UserUUID       string          `gorm:"type:char(36);not null;primaryKey"`
	Role           string          `gorm:"type:varchar(16);not null"`
	AdminUsers     []AdminUser     `gorm:"foreignKey:UserUUID;references:UserUUID"`
	GeneralUsers   []GeneralUser   `gorm:"foreignKey:UserUUID;references:UserUUID"`
	DomainUsers    []DomainUser    `gorm:"foreignKey:UserUUID;references:UserUUID"`
	UploadedImages []UploadedImage `gorm:"foreignKey:Owner;references:UserUUID"`
}

type UserInfo

type UserInfo interface {
	GetUserID() string
	GetEmail() string
	GetName() string
	GetRole() consts.UserType
	ToUserResponse() *UserResponse
}

type UserResponse

type UserResponse struct {
	UserUUID string `json:"user_uuid"`
	Email    string `json:"email"`
	Name     string `json:"name"`
	Role     string `json:"role"`
	ClubUUID string `json:"club_uuid,omitempty"`
}

Jump to

Keyboard shortcuts

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