Documentation
¶
Index ¶
- Constants
- func CfgSyncDatabase(db *gorm.DB, res *CfgSchema) error
- func CfgUpdate(db *gorm.DB, arg *CfgModel) error
- func LoadDatabase(isTest bool) *gorm.DB
- type BaseModel
- type CfgModel
- type CfgSchema
- type JsonArrayUint
- func (j JsonArrayUint) AppendOrRemove(e uint) (isExist bool, a JsonArrayUint)
- func (j JsonArrayUint) Equals(j1 JsonArrayUint) bool
- func (j JsonArrayUint) IsNull() bool
- func (m JsonArrayUint) MarshalJSONArrayUint() ([]byte, error)
- func (o *JsonArrayUint) Scan(input interface{}) (err error)
- func (m *JsonArrayUint) UnmarshalJSONArrayUint(data []byte) error
- func (o JsonArrayUint) Value() (driver.Value, error)
- type Machine
- type PaginationQ
- type SshRole
- type User
Constants ¶
View Source
const ( RoleUser = SshRole("user") RoleAdmin = SshRole("admin") )
Variables ¶
This section is empty.
Functions ¶
func LoadDatabase ¶
Types ¶
type CfgModel ¶
type CfgSchema ¶
type CfgSchema struct {
Secret string `desc:"APP secret 16/24/32长度" def:"uaz6225fFMTIwScSjRB842ujvQdlxyMS"`
Version string `desc:"版本号" def:"v0.0.1"`
QiniuAk string `desc:"七牛云AK" def:"xxx"`
QiniuSk string `desc:"七牛云SK" def:"sk"`
QiniuBucket string `desc:"七牛云Bucket" def:"mojocn"`
QiniuBucketEndPoint string `desc:"七牛云Bucket endpoint" def:"https://s3.mojotv.cn"`
TencentCloudAk string `desc:"腾讯云AK" def:"-"`
TencentCloudSk string `desc:"腾讯云SK" def:"-"`
AddrRpc string `desc:"私有启动RPC服务地址,提供给sshd进行通讯和调用" def:"127.0.0.1:8099"`
AddrWebSshd string `desc:"私有启动sshd网页服务地址" def:"127.0.0.1:8025"`
AddrWebUi string `desc:"私有启动felix本地web管理地址" def:"127.0.0.1:8014"`
AddrGuacamole string `desc:"第三方guacamole gaucd服务启动的地址" def:"10.13.84.219:4822"`
}
type JsonArrayUint ¶
type JsonArrayUint []uint
func (JsonArrayUint) AppendOrRemove ¶
func (j JsonArrayUint) AppendOrRemove(e uint) (isExist bool, a JsonArrayUint)
func (JsonArrayUint) Equals ¶
func (j JsonArrayUint) Equals(j1 JsonArrayUint) bool
func (JsonArrayUint) IsNull ¶
func (j JsonArrayUint) IsNull() bool
func (JsonArrayUint) MarshalJSONArrayUint ¶
func (m JsonArrayUint) MarshalJSONArrayUint() ([]byte, error)
func (*JsonArrayUint) Scan ¶
func (o *JsonArrayUint) Scan(input interface{}) (err error)
func (*JsonArrayUint) UnmarshalJSONArrayUint ¶
func (m *JsonArrayUint) UnmarshalJSONArrayUint(data []byte) error
type Machine ¶
type Machine struct {
BaseModel
Protocol string `json:"protocol"` // ssh rdp vnc
Name string `json:"name"`
Host string `json:"host"`
Ip string `json:"ip"`
Port int `json:"port"`
Remark string `json:"remark"`
User string `json:"user"`
Password string `json:"password"`
PrivateKey string `json:"private_key"`
PrivateKeyPassword string `json:"private_key_password"`
WebSshURL string `gorm:"-" json:"web_ssh_url"`
}
func MachineFrom ¶
func (*Machine) GenerateToken ¶
type PaginationQ ¶
type PaginationQ struct {
Ok bool `json:"ok"`
Size int `form:"size" json:"size"`
Page int `form:"page" json:"page"`
Data interface{} `json:"data" comment:"muster be a pointer of slice gorm.Model"` // save pagination list
Total int64 `json:"total"`
}
PaginationQ gin handler query binding struct
func (*PaginationQ) SearchAll ¶
func (p *PaginationQ) SearchAll(queryTx *gorm.DB) (data *PaginationQ, err error)
SearchAll optimized pagination method for gorm
type User ¶
type User struct {
BaseModel
Role string `json:"role"`
RealName string `json:"real_name"`
Account string `json:"account"`
Avatar string `json:"avatar"`
Name string `json:"name"`
Email string `json:"email"`
Phone string `json:"phone"`
Password string `json:"password"`
Secret string `json:"-"`
GithubAccount string `json:"github_account"`
PublicKey string `json:"public_key"`
}
Click to show internal directories.
Click to hide internal directories.