Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Announcement ¶
type Announcement struct { BaseModel Level string `json:"level"` Title string `json:"title"` Content string `json:"content"` }
Announcement is used by admin to annouce sth
type ForgetPassword ¶
type MailConfig ¶
type Node ¶
type Node struct { BaseModel Name string `json:"name"` Description string `json:"description"` Groups []*Group `gorm:"many2many:groups_nodes;" json:"-"` Services []*Service `json:"-"` Host string `json:"host"` // The Host to access v2ray Ports string `json:"ports"` AccessToken string `json:"-"` CurrentTraffic uint64 `json:"current_traffic"` MaxTraffic uint64 `json:"max_traffic"` HasUDP bool `json:"hasUDP"` HasMultiPort bool `json:"hasMultiPort"` Settings `json:"settings"` }
Node is a struct of node info
type Settings ¶
type Settings struct { Listen string `json:"listen"` Port uint `json:"port"` VmessSetting `json:"vmessSettings"` ShadowsocksSetting `json:"shadowsocksSettings"` }
type ShadowsocksSetting ¶
type ShadowsocksSetting struct{}
type SniffingSettings ¶
type SniffingSettings struct{}
type StreamSettings ¶
type StreamSettings struct {
TransportProtocol string `json:"protocol"`
}
type User ¶
type User struct { BaseModel UUID string `gorm:"unique" json:"uuid" fake:"{uuid}"` Token map[string]time.Time `json:"-" gorm:"-" fake:"skip"` // gorm doesn't support complex type so hav to marshal it TokenStr string `json:"-" gorm:"column:token" fake:"skip"` // the actual data is stored here JwtKey []byte `json:"-" fake:"skip"` // Do not export it due to leak risk Email string `gorm:"unique" json:"email" fake:"{email}"` Username string `gorm:"unique" json:"username" fake:"{username}"` Password string `json:"-" fake:"{password:true,true,true,true,true,8}"` SubscriptionToken string `json:"subscription_token"` CurrentTraffic int64 `json:"current_traffic"` MaxTraffic int64 `json:"max_traffic"` Groups []*Group `gorm:"many2many:groups_users;" json:"-" fake:"skip"` }
User table model
func (*User) BeforeSave ¶
BeforeSave marshal the token map This is a GORM feature called hook
type VmessSetting ¶
type VmessSetting struct { StreamSettings `json:"streamSettings"` SniffingSettings // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.