Documentation ¶
Overview ¶
Package org 封装企业资源相关操作
Index ¶
- type Option
- type Org
- func (o *Org) ChangeCurrentOrg(userID string, req *apistructs.OrgChangeRequest) error
- func (o *Org) Create(createReq apistructs.OrgCreateRequest) (*model.Org, error)
- func (o *Org) CreateWithEvent(userID string, createReq apistructs.OrgCreateRequest) (*model.Org, error)
- func (o *Org) Delete(orgID int64) error
- func (o *Org) DereferenceCluster(userID string, req *apistructs.DereferenceClusterRequest) error
- func (o *Org) FetchOrgResources(orgID uint64) (*apistructs.OrgResourceInfo, error)
- func (o *Org) GenVerifiCode(identityInfo apistructs.IdentityInfo, orgID uint64) (string, error)
- func (o *Org) Get(orgID int64) (*model.Org, error)
- func (o *Org) GetByName(orgName string) (*model.Org, error)
- func (o *Org) GetCurrentOrgByUser(userID string) (int64, error)
- func (o *Org) GetNotifyConfig(orgID int64) (*apistructs.OrgConfig, error)
- func (o *Org) GetOrgByDomain(domain string) (*model.Org, error)
- func (o *Org) GetOrgByDomainAndOrgName(domain, orgName string) (*model.Org, error)
- func (o *Org) List() ([]model.Org, error)
- func (o *Org) ListAllOrgClusterRelation() ([]model.OrgClusterRelation, error)
- func (o *Org) ListByIDsAndName(orgIDs []int64, name string, pageNo, pageSize int) (int, []model.Org, error)
- func (o *Org) RelateCluster(userID string, req *apistructs.OrgClusterRelationCreateRequest) error
- func (o *Org) SearchByName(name string, pageNo, pageSize int) (int, []model.Org, error)
- func (o *Org) SearchPublicOrgsByName(name string, pageNo, pageSize int) (int, []model.Org, error)
- func (o *Org) SetNotifyConfig(orgID int64, notifyConfig apistructs.NotifyConfigUpdateRequestBody) error
- func (o *Org) SetReleaseCrossCluster(orgID uint64, enable bool) error
- func (o *Org) Update(orgID int64, updateReq apistructs.OrgUpdateRequestBody) (*model.Org, error)
- func (o *Org) UpdateWithEvent(orgID int64, updateReq apistructs.OrgUpdateRequestBody) (*model.Org, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*Org)
Option 定义 Org 对象的配置选项
func WithRedisClient ¶
WithRedisClient 配置 redis client
type Org ¶
type Org struct {
// contains filtered or unexported fields
}
Org 资源对象操作封装
func (*Org) ChangeCurrentOrg ¶
func (o *Org) ChangeCurrentOrg(userID string, req *apistructs.OrgChangeRequest) error
ChangeCurrentOrg 切换用户当前所属企业
func (*Org) Create ¶
func (o *Org) Create(createReq apistructs.OrgCreateRequest) (*model.Org, error)
Create 创建企业处理逻辑
func (*Org) CreateWithEvent ¶
func (o *Org) CreateWithEvent(userID string, createReq apistructs.OrgCreateRequest) (*model.Org, error)
CreateWithEvent 创建企业 & 发送创建事件
func (*Org) DereferenceCluster ¶
func (o *Org) DereferenceCluster(userID string, req *apistructs.DereferenceClusterRequest) error
DereferenceCluster 解除关联集群关系
func (*Org) FetchOrgResources ¶
func (o *Org) FetchOrgResources(orgID uint64) (*apistructs.OrgResourceInfo, error)
FetchOrgResources 获取企业资源情况
func (*Org) GenVerifiCode ¶
func (o *Org) GenVerifiCode(identityInfo apistructs.IdentityInfo, orgID uint64) (string, error)
GenVerifiCode 生成邀请成员加入企业的验证码
func (*Org) GetCurrentOrgByUser ¶
GetCurrentOrgByUser 根据userID获取用户当前关联企业
func (*Org) GetNotifyConfig ¶
func (o *Org) GetNotifyConfig(orgID int64) (*apistructs.OrgConfig, error)
GetNotifyConfig 获取通知配置
func (*Org) GetOrgByDomain ¶
GetOrgByDomain 通过域名获取企业
func (*Org) GetOrgByDomainAndOrgName ¶
Get Org by domain and org name
func (*Org) ListAllOrgClusterRelation ¶
func (o *Org) ListAllOrgClusterRelation() ([]model.OrgClusterRelation, error)
ListAllOrgClusterRelation 获取所有企业对应集群关系
func (*Org) ListByIDsAndName ¶
func (o *Org) ListByIDsAndName(orgIDs []int64, name string, pageNo, pageSize int) (int, []model.Org, error)
ListByIDsAndName 根据IDs列表 & name 获取企业列表
func (*Org) RelateCluster ¶
func (o *Org) RelateCluster(userID string, req *apistructs.OrgClusterRelationCreateRequest) error
RelateCluster 关联集群,创建企业集群关联关系
func (*Org) SearchByName ¶
SearchByName 按企业名称过滤
func (*Org) SearchPublicOrgsByName ¶
Search public orgs
func (*Org) SetNotifyConfig ¶
func (o *Org) SetNotifyConfig(orgID int64, notifyConfig apistructs.NotifyConfigUpdateRequestBody) error
SetNotifyConfig 设置通知配置
func (*Org) SetReleaseCrossCluster ¶
SetReleaseCrossCluster 设置企业是否允许跨集群部署开关
func (*Org) Update ¶
func (o *Org) Update(orgID int64, updateReq apistructs.OrgUpdateRequestBody) (*model.Org, error)
Update 更新企业
func (*Org) UpdateWithEvent ¶
func (o *Org) UpdateWithEvent(orgID int64, updateReq apistructs.OrgUpdateRequestBody) (*model.Org, error)
UpdateWithEvent 更新企业 & 发送更新事件
Click to show internal directories.
Click to hide internal directories.