Documentation ¶
Index ¶
Constants ¶
View Source
const ( LAVEL_USER_BLOCK int = iota LEVEL_USER_ADMIN LAVEL_USER_NORMAL )
View Source
const (
ClientProxyMode_Trojan = "trojan"
)
Variables ¶
This section is empty.
Functions ¶
func AutoMigrate ¶
func AutoMigrate(dst ...interface{}) error
func Initialize ¶
func Initialize() (err error)
Types ¶
type Node ¶
type Node struct { gorm.Model NodeName string `json:"nodeName"` NodeAddr string `json:"nodeAddr"` NodePort string `json:"nodePort"` NodeTag string `json:"nodeTag"` ClientAddr string `json:"clientAddr"` ClientPort string `json:"clientPort"` ClientProxyMode string `json:"clientProxyMode"` Users []User `gorm:"many2many:node_user;"` }
type User ¶
type User struct { gorm.Model Email string `json:"email" gorm:"email,unique,omitempty"` Password string `json:"password" gorm:"password,omitempty"` Role int `json:"role" gorm:"role,omitempty"` Hash string `json:"-" gorm:"hash,omitempty"` Token string `json:"token"` Locked bool `json:"locked"` Nodes []Node `json:"nodes" gorm:"many2many:node_user;"` }
func (*User) BeforeCreate ¶
func (u *User) BeforeCreate()
Click to show internal directories.
Click to hide internal directories.