package
Version:
v0.0.0-...-caf001f
Opens a new window with list of versions in this module.
Published: Sep 11, 2022
License: MIT
Opens a new window with license information.
Imports: 4
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
type Account struct {
Base
UserName string `json:"user_name" valid:"required"`
Email string `json:"email" valid:"required"`
Password string `json:"password" valid:"required"`
}
type Base struct {
ID string `json:"id" valid:"uuid"`
CreatedAt time.Time `json:"created_at" valid:"-"`
UpdatedAt time.Time `json:"updated_at" valid:"-"`
}
type Book struct {
Base
Title string `json:"title" valid:"required"`
Author string `json:"author" valid:"required"`
Price float64 `json:"price" valid:"required"`
Description string `json:"description" valid:"required"`
UserID string `json:"userId" valid:"required"`
}
type User struct {
Base
Name string `json:"name" valid:"required"`
UserName string `json:"user_name" valid:"required"`
Email string `json:"email" valid:"email"`
Books []Book `json:"books" valid:"-"`
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.