Documentation ¶
Index ¶
- Constants
- func InitError()
- func InitLdap(ldap LdapSection)
- func LdapReq(user, pass string) (*ldap.SearchResult, error)
- type CasBinInReceive
- type CasBinInfo
- type CasBinModel
- type Casbin
- type ClusterIds
- type ClusterNodesStatus
- type ClusterVersion
- type Dept
- type GModel
- type K8SCluster
- type LdapSection
- type LocalTime
- type LoginUser
- type Menu
- type PaginationQ
- type Role
- type User
Constants ¶
View Source
const ( // 本地时间格式 MsecLocalTimeFormat = "2006-01-02 15:04:05.000" SecLocalTimeFormat = "2006-01-02 15:04:05" DateLocalTimeFormat = "2006-01-02" )
Variables ¶
This section is empty.
Functions ¶
func InitLdap ¶
func InitLdap(ldap LdapSection)
Types ¶
type CasBinInReceive ¶
type CasBinInReceive struct { Role string `json:"role"` CasBinInfos []CasBinInfo `json:"casBinInfos"` }
CasBinInReceive structure for input parameters
type CasBinInfo ¶
type CasBinModel ¶
type Casbin ¶
type Casbin struct {
ModelPath string `mapstructure:"model-path" json:"modelPath" yaml:"model-path"`
}
type ClusterIds ¶
type ClusterIds struct {
Data interface{} `json:"clusterIds"`
}
type ClusterNodesStatus ¶
type ClusterNodesStatus struct { NodeCount int `json:"node_count"` Ready int `json:"ready"` UnReady int `json:"unready"` Namespace int `json:"namespace"` Deployment int `json:"deployment"` Pod int `json:"pod"` CpuUsage float64 `json:"cpu_usage" desc:"cpu使用率"` CpuCore float64 `json:"cpu_core"` CpuCapacityCore float64 `json:"cpu_capacity_core"` MemoryUsage float64 `json:"memory_usage" desc:"内存使用率"` MemoryUsed float64 `json:"memory_used"` MemoryTotal float64 `json:"memory_total"` }
type ClusterVersion ¶
func (ClusterVersion) TableName ¶
func (v ClusterVersion) TableName() string
type Dept ¶
type Dept struct { GModel Name string `gorm:"comment:'部门名称';size:64" json:"name"` Sort int `gorm:"default:0;type:int(3);comment:'排序'" json:"sort"` ParentId uint `gorm:"default:0;comment:'父级部门(编号为0时表示根)'" json:"parent_id"` Children []Dept `gorm:"-" json:"children"` // 下属部门集合 Users []User `gorm:"foreignkey:DeptId"` // 一个部门有多个user }
type GModel ¶
type K8SCluster ¶
type K8SCluster struct { //ID uint `json:"id" gorm:"primarykey;AUTO_INCREMENT" form:"id"` GModel ClusterName string `json:"clusterName" gorm:"comment:集群名称" form:"clusterName" binding:"required"` KubeConfig string `json:"kubeConfig" gorm:"comment:集群凭证;type:varchar(12800)" binding:"required"` ClusterVersion string `json:"clusterVersion" gorm:"comment:集群版本"` NodeNumber int `json:"nodeNumber" gorm:"comment:节点数"` }
func (K8SCluster) TableName ¶
func (ks K8SCluster) TableName() string
type LdapSection ¶
type LdapSection struct { Enable bool `yaml:"enable"` Host string `yaml:"host"` Port int `yaml:"port"` BaseDn string `yaml:"baseDn"` BindUser string `yaml:"bindUser"` BindPass string `yaml:"bindPass"` AuthFilter string `yaml:"authFilter"` Attributes ldapAttributes `yaml:"attributes"` CoverAttributes bool `yaml:"coverAttributes"` TLS bool `yaml:"tls"` StartTLS bool `yaml:"startTLS"` }
var LDAP LdapSection
type LocalTime ¶
本地时间
func (LocalTime) DateString ¶
func (LocalTime) MarshalJSON ¶
func (*LocalTime) UnmarshalJSON ¶
type Menu ¶
type Menu struct { GModel Name string `gorm:"comment:'菜单名称';size:64" json:"name"` Icon string `gorm:"comment:'菜单图标';size:64" json:"icon"` Path string `gorm:"comment:'菜单访问路径';size:64" json:"path"` Sort int `gorm:"default:0;type:int(3);comment:'菜单顺序(同级菜单, 从0开始, 越小显示越靠前)'" json:"sort"` ParentId uint `gorm:"default:0;comment:'父菜单编号(编号为0时表示根菜单)'" json:"parent_id"` Creator string `gorm:"comment:'创建人';size:64" json:"creator"` Children []Menu `gorm:"-" json:"children"` Roles []Role `gorm:"many2many:relation_role_menu;" json:"roles"` }
type PaginationQ ¶
type Role ¶
type User ¶
type User struct { GModel UID string `gorm:"column:uid;comment:'用戶uid'" json:"uid"` UserName string `gorm:"column:username;comment:'用户名';size:128;uniqueIndex:uk_username" json:"username" binding:"required"` Password string `gorm:"column:password;comment:'用户密码';size:128" json:"password" binding:"required"` Phone string `gorm:"column:phone;comment:'手机号码';size:11" json:"phone"` Email string `gorm:"column:email;comment:'邮箱';size:128" json:"email"` NickName string `gorm:"column:nick_name;comment:'用户昵称';size:128" json:"nick_name"` Avatar string `gorm:"column:avatar;default:https://www.dnsjia.com/luban/img/head.png;comment:'用户头像';size:128" json:"avatar"` Status *bool `gorm:"type:tinyint(1);default:true;comment:'用户状态(正常/禁用, 默认正常)'"` RoleId uint `gorm:"column:role_id;comment:'角色id外键'" json:"role_id"` Role Role `gorm:"foreignkey:RoleId" json:"role"` DeptId uint64 `gorm:"comment:'部门id外键'" json:"dept_id"` Dept Dept `gorm:"foreignkey:DeptId" json:"dept"` CreateBy string `gorm:"column:create_by;comment:'创建来源'" json:"create_by"` }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.