Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecryptCipher ¶
DecryptCipher : Decrypt the cipher with the password
func EncryptCipher ¶
EncryptCipher : Encrypt the cipher with the password
func VerifyPassword ¶
VerifyPassword : Verify the hashed password with the to be checked
Types ¶
type Device ¶
type Device struct {
ID uint `gorm:"primary_key"`
UserID uint `gorm:"" json:"userId"`
Name string `gorm:"size:100;not null" json:"name"`
PrivateKey string `gorm:"size:255;not null" json:"privateKey"`
PublicKey string `gorm:"size:255;not null" json:"publicKey"`
IPv4Address string `gorm:"size:15;not null" json:"ipv4Address"`
IPv6Address string `gorm:"size:45;not null" json:"ipv6Address"`
CreatedAt time.Time `gorm:"precision:6" json:"createdAt"`
UpdatedAt time.Time `gorm:"precision:6" json:"updatedAt"`
}
Device : Device model
type Group ¶
type Group struct {
ID uint `gorm:"primary_key"`
Name string `gorm:"size:255;not null;unique" json:"name"`
Users []*UserGroup `gorm:"association_autoupdate:false;association_autocreate:false;preload:false;foreignkey:GroupID" json:"users"` // nolint:lll
Type string `gorm:"size:100;not null" json:"type"`
CreatedAt time.Time `gorm:"precision:6" json:"createdAt"`
UpdatedAt time.Time `gorm:"precision:6" json:"updatedAt"`
}
Group : Group model
type User ¶
type User struct {
ID uint `gorm:"primary_key"`
Username string `gorm:"size:100;not null;unique" json:"username"`
Password string `gorm:"size:100;not null" json:"password"`
ProtectPassword string `gorm:"size:100" json:"protectPassword"`
Cipher string `gorm:"size:125;not null" json:"cipher"`
FirstName string `gorm:"size:100;not null" json:"firstName"`
LastName string `gorm:"size 100;not null" json:"lastName"`
Mail string `gorm:"size 100;not null" json:"mail"`
Type string `gorm:"size 50;not null" json:"type"`
Devices []*Device `gorm:"foreignkey:userId" json:"devices"`
CreatedAt time.Time `gorm:"precision:6" json:"createdAt"`
UpdatedAt time.Time `gorm:"precision:6" json:"updatedAt"`
}
User : User model
func (*User) BeforeSave ¶
BeforeSave : Hook before saving the user
type UserGroup ¶
type UserGroup struct {
GroupID uint `gorm:"not null;primary_key;auto_increment:false" json:"groupId"`
UserID uint `gorm:"not null;primary_key;auto_increment:false" json:"userId"`
Group Group `gorm:"association_autoupdate:false;association_autocreate:false;preload:false;foreignkey:GroupID" json:"groups"` // nolint:lll
User User `gorm:"association_autoupdate:false;association_autocreate:false;preload:false;foreignkey:UserID" json:"users"` // nolint:lll
}
UserGroup : Mapping user to groups
Click to show internal directories.
Click to hide internal directories.