Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Group ¶
type Group struct { Model Name string `yaml:"name" json:"name"` Description string `yaml:"description" json:"description"` Role string `yaml:"role" json:"role"` Users []User `gorm:"many2many:user_groups;" yaml:"-" json:"-"` Permissions []Permission `yaml:"-" json:"-"` }
Group .
type Model ¶
type Model struct { ID UUID `sql:",type:uuid" json:"id"` CreatedAt time.Time `sql:"default:now()" json:"created_at"` DeletedAt *time.Time `json:"deleted_at,omitempty"` }
Model .
type Permission ¶
type Permission struct { Model DatabaseName string `yaml:"database" json:"database"` TableName string `yaml:"table" json:"table"` Select bool `yaml:"select" json:"select"` Insert bool `yaml:"insert" json:"insert"` Update bool `yaml:"update" json:"update"` Delete bool `yaml:"delete" json:"delete"` UserID UUID `yaml:"user_id" json:"user_id"` GroupID UUID `yaml:"group_id" json:"group_id"` }
Permission .
type UUID ¶
type UUID [16]byte
UUID implement for go-pg convert uuid
func MustGetUUIDFromString ¶
MustGetUUIDFromString get uuid from string if failed throw panic, CAUTION: IT ONLY USE FOR TESTING
func UUIDFromString ¶
UUIDFromString convert string to UUID
func (UUID) MarshalJSON ¶
MarshalJSON implement for json encoding
func (*UUID) UnmarshalJSON ¶
UnmarshalJSON implement for json decoding
type User ¶
type User struct { Model Username string `yaml:"username" json:"username"` Password string `yaml:"-" json:"-"` PasswordDigest string `yaml:"password_digest" json:"password_digest"` Role string `yaml:"role" json:"role"` Email string `yaml:"email" json:"email"` ConfirmCode string `yaml:"confirm_code" json:"confirm_code"` Groups []Group `gorm:"many2many:user_groups;" yaml:"-" json:"-"` Permissions []Permission `yaml:"-" json:"-"` }
User .
Click to show internal directories.
Click to hide internal directories.