Discover Packages
github.com/ehsaniara/go-crash
models
package
Version:
v0.0.0-...-8b6cda5
Opens a new window with list of versions in this module.
Published: Dec 12, 2021
License: MIT
Opens a new window with license information.
Imports: 6
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
CheckAuth checks if authentication information exists
Setup initializes the database instance
type Auth struct {
ID int `json:"id" gorm:"primary_key"`
Username string `json:"username" gorm:"not null;unique"`
Password string `json:"password" gorm:"not null"`
}
type Customer struct {
Model
FirstName string `json:"firstName" validate:"required" gorm:"not null"`
LastName string `json:"lastName" validate:"required" gorm:"not null"`
Title string `json:"title" validate:"required" gorm:"not null"`
CreatedBy string `json:"createdBy"`
ModifiedBy string `json:"modifiedBy"`
}
type Model struct {
ID int `gorm:"primary_key" json:"id"`
CreatedOn time .Time `json:"createdOn" sql:"DEFAULT:'current_timestamp'"`
ModifiedOn time .Time `json:"modifiedOn"`
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.