Documentation ¶
Index ¶
- Constants
- func InitOpTypeData(db *gorm.DB) error
- type AuthPermission
- type AuthRole
- type AuthRolePermission
- type AuthRoleVo
- type AuthUser
- type AuthUserRole
- type AuthUserVo
- type Cluster
- func (c *Cluster) Create() error
- func (c *Cluster) Find(param FindClusterParam) ([]Cluster, int64, error)
- func (c *Cluster) FindAll(name string) ([]Cluster, error)
- func (c *Cluster) FindId(id int64) error
- func (c *Cluster) FindName(name string) (*Cluster, error)
- func (c *Cluster) FindTag(tag string) (*Cluster, error)
- func (c *Cluster) Update(id int64, set map[string]interface{}) error
- type FindAuthPermissionParam
- type FindAuthRoleParam
- type FindAuthUserParam
- type FindClusterParam
- type FindOpLogParam
- type FindVolsParam
- type NodeConfig
- type NodeConfigFailure
- type OpType
- type OpTypeUpdateParam
- type OperationLog
- type User
- type Vol
Constants ¶
View Source
const ( PasswordMinLength = 8 PasswordMaxLength = 16 )
Variables ¶
This section is empty.
Functions ¶
func InitOpTypeData ¶
Types ¶
type AuthPermission ¶
type AuthPermission struct { Id int `gorm:"primaryKey;AUTO_INCREMENT;column:id;" json:"id"` AuthCode string `gorm:"index:idx_code,unique;column:auth_code;type:varchar(128);not null;" json:"auth_code"` AuthName string `gorm:"column:auth_name;type:varchar(128);not null;" json:"auth_name"` AuthType *int `gorm:"column:auth_type;type:int(5);default:0;not null;" json:"auth_type"` // 0. backend api auth 1. front auth URI string `gorm:"column:uri;type:varchar(200);" json:"uri"` Method string `gorm:"column:method;type:varchar(10);" json:"method"` Group string `gorm:"column:group;type:varchar(128);" json:"group"` IsLogin bool `gorm:"column:is_login;type:tinyint(1);default:false;not null" json:"is_login"` IsCheck bool `gorm:"column:is_check;type:tinyint(1);default:false;not null" json:"is_check"` CreateTime time.Time `gorm:"column:create_time;not null;autoCreateTime;type:datetime" json:"createTime"` UpdateTime time.Time `gorm:"column:update_time;not null;autoUpdateTime;type:datetime" json:"updateTime"` }
func (*AuthPermission) Create ¶
func (p *AuthPermission) Create() error
func (*AuthPermission) Delete ¶
func (p *AuthPermission) Delete(ids []int) error
func (*AuthPermission) Find ¶
func (p *AuthPermission) Find(param *FindAuthPermissionParam) ([]AuthPermission, int, error)
func (*AuthPermission) IsValid ¶
func (p *AuthPermission) IsValid() error
func (*AuthPermission) Update ¶
func (p *AuthPermission) Update() error
type AuthRole ¶
type AuthRole struct { Id int `gorm:"primaryKey;AUTO_INCREMENT;column:id;" json:"id"` RoleCode string `gorm:"index:idx_code,unique;column:role_code;type:varchar(128);not null;" json:"role_code"` RoleName string `gorm:"index:idx_name,unique;column:role_name;type:varchar(128);not null" json:"role_name"` MaxVolCount int `gorm:"column:max_vol_count;type:int;" json:"max_vol_count"` MaxVolSize int `gorm:"column:max_vol_size;type:int;" json:"max_vol_size"` CreateTime time.Time `gorm:"column:create_time;not null;autoCreateTime;type:datetime" json:"createTime"` UpdateTime time.Time `gorm:"column:update_time;not null;autoUpdateTime;type:datetime" json:"updateTime"` }
func (*AuthRole) Find ¶
func (r *AuthRole) Find(param *FindAuthRoleParam) ([]AuthRoleVo, int, error)
type AuthRolePermission ¶
type AuthRolePermission struct { Id int `gorm:"primaryKey;AUTO_INCREMENT;column:id;" json:"id"` RoleId int `gorm:"index:idx_role_permission,unique;column:role_id;type:int;not null;" json:"role_id"` PermissionId int `gorm:"index:idx_role_permission,unique;column:permission_id;type:int;not null;" json:"permission_id"` }
type AuthRoleVo ¶
type AuthRoleVo struct { AuthRole Permissions []AuthPermission `json:"permissions"` }
type AuthUser ¶
type AuthUser struct { Id int `gorm:"primaryKey;AUTO_INCREMENT;column:id;" json:"id"` UserName string `gorm:"index:idx_name,unique;column:user_name;type:varchar(32);not null;" json:"user_name"` Password string `gorm:"column:password;type:varchar(128);not null" json:"password"` Email string `gorm:"index:idx_email,unique;column:email;type:varchar(128);not null" json:"email"` Phone string `gorm:"index:idx_phone,unique;column:phone;type:varchar(11);not null" json:"phone"` CreateTime time.Time `gorm:"column:create_time;not null;autoCreateTime;type:datetime" json:"createTime"` UpdateTime time.Time `gorm:"column:update_time;not null;autoUpdateTime;type:datetime" json:"updateTime"` }
func (*AuthUser) Find ¶
func (u *AuthUser) Find(param *FindAuthUserParam) ([]AuthUserVo, int, error)
func (*AuthUser) UpdatePassword ¶
type AuthUserRole ¶
type AuthUserVo ¶
type Cluster ¶
type Cluster struct { Id int64 `gorm:"primaryKey;auto_increment" json:"id"` Name string `gorm:"type:varchar(100);not null;default:'';index" json:"name"` MasterAddr types.StrSlice `gorm:"type:varchar(1024);not null;default:'[]'" json:"master_addr"` IDC string `gorm:"column:idc;type:varchar(255);not null;default:''" json:"idc"` Cli string `gorm:"type:varchar(255);not null;default:''" json:"cli"` Domain string `gorm:"type:varchar(255);not null;default:''" json:"domain"` ConsulAddr string `gorm:"type:varchar(255);not null;default:''" json:"consul_addr"` Tag string `gorm:"type:varchar(255);not null;default:'';index" json:"tag"` S3Endpoint string `gorm:"column:s3_endpoint;type:varchar(255);not null;default:''" json:"s3_endpoint"` VolType enums.VolType `gorm:"type:tinyint(1);not null;default:0" json:"vol_type"` CreateTime time.Time `gorm:"create_time" json:"create_time"` UpdateTime time.Time `gorm:"update_time" json:"update_time"` }
type FindAuthPermissionParam ¶
type FindAuthRoleParam ¶
type FindAuthUserParam ¶
type FindClusterParam ¶
type FindOpLogParam ¶
type FindOpLogParam struct { Page int `form:"page"` PerPage int `form:"per_page"` OpTypeId int `form:"op_type_id"` UserId int `form:"user_id"` }
func (*FindOpLogParam) Check ¶
func (p *FindOpLogParam) Check() error
type FindVolsParam ¶
type FindVolsParam struct { Owner string `form:"owner" binding:"required"` Page int `form:"page"` PerPage int `form:"per_page"` }
func (*FindVolsParam) Check ¶
func (p *FindVolsParam) Check() error
type NodeConfig ¶
type NodeConfig struct { Id int64 `gorm:"primaryKey" json:"id"` Node string `gorm:"type:varchar(255);index;not null;default:''" json:"node"` Cluster string `gorm:"type:varchar(255);not null;default:''" json:"cluster"` Configuration types.MapStr `gorm:"type:varchar(2048);not null;default:'{}'" json:"configuration"` UpdatedAt time.Time `json:"updated_at"` }
func (*NodeConfig) One ¶
func (e *NodeConfig) One(node, cluster string) error
func (*NodeConfig) Upsert ¶
func (e *NodeConfig) Upsert(node, cluster, key, value string) error
type NodeConfigFailure ¶
type NodeConfigFailure struct { Id int64 `gorm:"primaryKey" json:"id"` Node string `gorm:"type:varchar(255);not null;default:''" json:"node"` Cluster string `gorm:"type:varchar(255);not null;default:''" json:"cluster"` Key string `gorm:"type:varchar(255);not null;default:''" json:"key"` Value string `gorm:"type:varchar(255);not null;default:''" json:"value"` FailedReason string `gorm:"type:varchar(255);not null;default:''" json:"failed_reason"` CreatedAt time.Time `json:"created_at"` }
func (*NodeConfigFailure) Insert ¶
func (e *NodeConfigFailure) Insert() error
func (*NodeConfigFailure) One ¶
func (e *NodeConfigFailure) One(node, cluster string) error
type OpType ¶
type OpType struct { Id int `gorm:"primaryKey" json:"id"` NameEN string `gorm:"type:varchar(100);not null;default:''" json:"name_en"` NameCN string `gorm:"type:varchar(100);not null;default:''" json:"name_cn"` URI string `gorm:"type:varchar(200);uniqueIndex:idx_uri_method;not null;default:''" json:"uri"` Method string `gorm:"type:varchar(10);uniqueIndex:idx_uri_method;not null;default:''" json:"method"` Record bool `gorm:"not null;default:0" json:"record"` CreateTime time.Time `gorm:"not null;default:CURRENT_TIMESTAMP(3)" json:"create_time"` UpdateTime time.Time `gorm:"not null;default:CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" json:"update_time"` }
func (*OpType) UpdateId ¶
func (o *OpType) UpdateId(param *OpTypeUpdateParam) error
type OpTypeUpdateParam ¶
type OperationLog ¶
type OperationLog struct { Id uint64 `gorm:"primaryKey" json:"id"` Service string `gorm:"type:varchar(20);not null;default:''" json:"service"` // blobstore/cubefs Cluster string `gorm:"type:varchar(255);index;not null;default:''" json:"cluster"` UserId int `gorm:"index;not null;default:0" json:"user_id"` UserName string `gorm:"type:varchar(50);not null;default:''" json:"user_name"` OpTypeId int `gorm:"index;not null;default:0" json:"op_type_id"` OpTypeEN string `gorm:"type:varchar(100);not null;default:''" json:"op_type_en"` OpTypeCN string `gorm:"type:varchar(100);not null;default:''" json:"op_type_cn"` URI string `gorm:"type:varchar(200);not null;default:''" json:"uri"` Method string `gorm:"type:varchar(10);not null;default:''" json:"method"` QueryParams types.Values `gorm:"type:varchar(1024);not null;default:''" json:"query_params"` BodyParams types.Map `gorm:"type:varchar(1024);not null;default:''" json:"body_params"` Result types.Map `gorm:"type:varchar(500);not null;default:''" json:"result"` CreateTime time.Time `gorm:"primaryKey" json:"create_time"` }
func (*OperationLog) Create ¶
func (o *OperationLog) Create() error
func (*OperationLog) Find ¶
func (o *OperationLog) Find(param *FindOpLogParam) ([]OperationLog, int64, error)
type User ¶
type User struct { Id uint64 `gorm:"primaryKey" json:"id"` Name string `gorm:"type:varchar(50);not null;default:'';uniqueIndex" json:"name"` Role int `gorm:"type:tinyint(4);not null;default:3" json:"role"` AccessKey types.EncryptStr `gorm:"type:varchar(500);not null;default:''" json:"access_key"` SecretKey types.EncryptStr `gorm:"type:varchar(500);not null;default:''" json:"secret_key"` CreatorId int `gorm:"not null;default:0;index" json:"creator_id"` CreateTime time.Time `gorm:"not null;default:CURRENT_TIMESTAMP(3)" json:"create_time"` }
type Vol ¶
type Vol struct { Id uint64 `gorm:"primaryKey" json:"id"` Name string `gorm:"type:varchar(100);not null;default:'';index" json:"name"` Owner string `gorm:"type:varchar(50);not null;default:'';index" json:"owner"` Capacity uint64 `gorm:"not null;default:0" json:"capacity"` CacheCap int `gorm:"not null;default:0" json:"cache_cap"` CrossZone bool `gorm:"not null;default:0" json:"cross_zone"` Business string `gorm:"type:varchar(200);not null;default:''" json:"business"` DefaultPriority bool `gorm:"not null;default:0" json:"default_priority"` ReplicaNumber int `gorm:"type:tinyint(4);not null;default:0" json:"replica_number"` VolType int `gorm:"type:tinyint(1);not null;default:0" json:"vol_type"` CreatorId int `gorm:"not null;default:0;index" json:"creator_id"` CreateTime time.Time `gorm:"not null;default:CURRENT_TIMESTAMP(3)" json:"create_time"` }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.