Documentation
¶
Index ¶
- func Hash(password string) ([]byte, error)
- func VerifyPassword(hashedPassword, password string) error
- type Base
- type CustomSchema
- func (p *CustomSchema) DeleteACustomSchema(db *gorm.DB, pid uuid.UUID, uid uuid.UUID) (int64, error)
- func (p *CustomSchema) FindAllCustomSchemas(db *gorm.DB) (*[]CustomSchema, error)
- func (p *CustomSchema) FindAllMyCustomSchemas(db *gorm.DB, uid uuid.UUID) (*[]CustomSchema, error)
- func (p *CustomSchema) FindCustomSchemaByID(db *gorm.DB, pid uuid.UUID) (*CustomSchema, error)
- func (p *CustomSchema) GoFindAllMyCustomSchemas(db *gorm.DB, uid uuid.UUID) (*[]CustomSchemaResponse, error)
- func (p *CustomSchema) GoFindCustomSchemaByID(db *gorm.DB, pid uuid.UUID, uid uuid.UUID) (*CustomSchema, error)
- func (p *CustomSchema) Prepare()
- func (p *CustomSchema) SaveCustomSchema(db *gorm.DB) (*CustomSchema, error)
- func (p *CustomSchema) UpdateACustomSchema(db *gorm.DB) (*CustomSchema, error)
- func (p *CustomSchema) Validate() error
- type CustomSchemaResponse
- type User
- func (u *User) BeforeSave() error
- func (u *User) DeleteAUser(db *gorm.DB, uid uuid.UUID) (int64, error)
- func (u *User) FindAllUsers(db *gorm.DB) (*[]User, error)
- func (u *User) FindUserByID(db *gorm.DB, uid uuid.UUID) (*User, error)
- func (u *User) Prepare()
- func (u *User) SaveUser(db *gorm.DB) (*User, error)
- func (u *User) UpdateAUser(db *gorm.DB, uid uuid.UUID) (*User, error)
- func (u *User) Validate(action string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func VerifyPassword ¶
Types ¶
type Base ¶
type CustomSchema ¶
type CustomSchema struct {
Base
Name string `gorm:"size:255;not null" json:"name"`
Title string `gorm:"size:255;" json:"title"`
Description string `gorm:"size:255;" json:"description"`
FieldNames pq.StringArray `gorm:"type:text[];not null" json:"field_names"`
Data pgtype.JSONB `gorm:"type:jsonb;default:'[]';not null" json:"data"`
User User `json:"-"`
UserID uuid.UUID `gorm:"not null;type:uuid;" json:"user_id"`
UpdatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP" json:"updated_at"`
}
func (*CustomSchema) DeleteACustomSchema ¶
func (*CustomSchema) FindAllCustomSchemas ¶
func (p *CustomSchema) FindAllCustomSchemas(db *gorm.DB) (*[]CustomSchema, error)
func (*CustomSchema) FindAllMyCustomSchemas ¶
func (p *CustomSchema) FindAllMyCustomSchemas(db *gorm.DB, uid uuid.UUID) (*[]CustomSchema, error)
func (*CustomSchema) FindCustomSchemaByID ¶
func (p *CustomSchema) FindCustomSchemaByID(db *gorm.DB, pid uuid.UUID) (*CustomSchema, error)
func (*CustomSchema) GoFindAllMyCustomSchemas ¶
func (p *CustomSchema) GoFindAllMyCustomSchemas(db *gorm.DB, uid uuid.UUID) (*[]CustomSchemaResponse, error)
func (*CustomSchema) GoFindCustomSchemaByID ¶
func (p *CustomSchema) GoFindCustomSchemaByID(db *gorm.DB, pid uuid.UUID, uid uuid.UUID) (*CustomSchema, error)
func (*CustomSchema) Prepare ¶
func (p *CustomSchema) Prepare()
func (*CustomSchema) SaveCustomSchema ¶
func (p *CustomSchema) SaveCustomSchema(db *gorm.DB) (*CustomSchema, error)
func (*CustomSchema) UpdateACustomSchema ¶
func (p *CustomSchema) UpdateACustomSchema(db *gorm.DB) (*CustomSchema, error)
func (*CustomSchema) Validate ¶
func (p *CustomSchema) Validate() error
type CustomSchemaResponse ¶
type CustomSchemaResponse struct {
ID uuid.UUID `gorm:"primary_key;type:uuid;" json:"id"`
Name string `gorm:"size:255;not null" json:"name"`
Title string `gorm:"size:255;" json:"title"`
Description string `gorm:"size:255;" json:"description"`
Data pgtype.JSONB `gorm:"type:jsonb;default:'[]';not null" json:"data"`
User User `json:"-"`
UserID uuid.UUID `gorm:"not null;type:uuid;" json:"user_id"`
}
type User ¶
type User struct {
Base
Name string `gorm:"size:255;not null" json:"name"`
Age string `gorm:"size:255;" json:"age"`
Moto string `gorm:"size:255;" json:"moto"`
AboutYou string `gorm:"size:255;" json:"about_you"`
WhatDoYouDo string `gorm:"size:255;" json:"what_do_you_do"`
PhoneNumber string `gorm:"size:255;" json:"phone_number"`
ProfileImg string `gorm:"size:255;" json:"profile_img"`
ProfileIcon string `gorm:"size:255;" json:"profile_icon"`
Email string `gorm:"size:255;not null;unique" json:"email"`
Password string `gorm:"size:255;not null;" json:"password"`
UpdatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP" json:"updated_at"`
}
func (*User) BeforeSave ¶
Click to show internal directories.
Click to hide internal directories.