Documentation
¶
Index ¶
- func Hash(password string) ([]byte, error)
- func UpdatePrice(db *gorm.DB)
- func VerifyPassword(hashedPassword, password string) error
- type Price
- type Transaction
- type User
- func (user *User) BeforeSave() error
- func (user *User) DeleteAUser(db *gorm.DB, uid uint32) (int64, error)
- func (user *User) FindAllUsers(db *gorm.DB) (*[]User, error)
- func (user *User) FindUserByID(db *gorm.DB, uid uint32) (*User, error)
- func (user *User) Prepare()
- func (user *User) SaveUser(db *gorm.DB) (*User, error)
- func (user *User) UpdateAUser(db *gorm.DB, uid uint32) (*User, error)
- func (user *User) Validate(action string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func UpdatePrice ¶
func VerifyPassword ¶
Types ¶
type Price ¶
type Price struct { ID uint64 `gorm:"primary_key;auto_increment" json:"id"` BCToUSD float64 `gorm:"not null" json:"bc_usd"` USDToBC float64 `gorm:"not null" json:"usd_bc"` CreatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP" json:"created_at"` UpdatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP" json:"updated_at"` }
type Transaction ¶
type Transaction struct { ID uint64 `gorm:"primary_key;auto_increment" json:"id"` Type string `gorm:"size:255;not null" json:"type"` BCValue float64 `gorm:"not null" json:"bc_value"` USDValue float64 `gorm:"not null" json:"usd_value"` OwnerID uint32 `gorm:"nor null" json:"owner_id"` CreatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP" json:"created_at"` UpdatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP" json:"updated_at"` }
func (*Transaction) FindAllTransactions ¶
func (transaction *Transaction) FindAllTransactions(db *gorm.DB) (*[]Transaction, error)
func (*Transaction) SaveTransaction ¶
func (transaction *Transaction) SaveTransaction(db *gorm.DB) (*Transaction, error)
func (*Transaction) Validate ¶
func (transaction *Transaction) Validate() error
type User ¶
type User struct { ID uint32 `gorm:"primary_key;auto_increment" json:"id"` Name string `gorm:"size:255;not null;unique" json:"name"` Email string `gorm:"size:255;not null;unique" json:"email"` BirthDate time.Time `gorm:"default:CURRENT_TIMESTAMP" json:"birth_date"` Password string `gorm:"size:100;not null;" json:"password` BCBalance float64 `gorm:"default:0;not null" json:"bc_balance"` USDBalance float64 `gorm:"default:0;not null" json:"usd_balance"` CreatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP" json:"created_at"` UpdatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP" json:"updated_at"` }
func (*User) BeforeSave ¶
Click to show internal directories.
Click to hide internal directories.