org

package
v1.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 6, 2022 License: Apache-2.0 Imports: 19 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package org 封装企业资源相关操作

Index

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 WithBundle

func WithBundle(bdl *bundle.Bundle) Option

WithBundle 配置 bundle

func WithDBClient

func WithDBClient(db *dao.DBClient) Option

WithDBClient 配置 db client

func WithI18n added in v1.4.0

func WithI18n(trans i18n.Translator) Option

WithI18n sets the translator

func WithRedisClient

func WithRedisClient(cli *redis.Client) Option

WithRedisClient 配置 redis client

func WithUCClient

func WithUCClient(uc *ucauth.UCClient) Option

WithUCClient 配置 uc client

type Org

type Org struct {
	// contains filtered or unexported fields
}

Org 资源对象操作封装

func New

func New(options ...Option) *Org

New 新建 Org 实例,通过 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) Delete

func (o *Org) Delete(orgID int64) error

Delete 删除企业

func (*Org) DereferenceCluster

func (o *Org) DereferenceCluster(userID string, req *apistructs.DereferenceClusterRequest) error

DereferenceCluster 解除关联集群关系

func (*Org) FetchOrgResources deprecated

func (o *Org) FetchOrgResources(orgID uint64) (*apistructs.OrgResourceInfo, error)

FetchOrgResources 获取企业资源情况

Deprecated: The calculation caliber of the quota was reset on erda 1.3.3, please see FetchOrgClusterResource

func (*Org) GenVerifiCode

func (o *Org) GenVerifiCode(identityInfo apistructs.IdentityInfo, orgID uint64) (string, error)

GenVerifiCode 生成邀请成员加入企业的验证码

func (*Org) Get

func (o *Org) Get(orgID int64) (*model.Org, error)

Get 获取企业

func (*Org) GetByName

func (o *Org) GetByName(orgName string) (*model.Org, error)

GetByName 获取企业

func (*Org) GetCurrentOrgByUser

func (o *Org) GetCurrentOrgByUser(userID string) (int64, error)

GetCurrentOrgByUser 根据userID获取用户当前关联企业

func (*Org) GetNotifyConfig

func (o *Org) GetNotifyConfig(orgID int64) (*apistructs.OrgConfig, error)

GetNotifyConfig 获取通知配置

func (*Org) GetOrgByDomain

func (o *Org) GetOrgByDomain(domain string) (*model.Org, error)

GetOrgByDomain 通过域名获取企业

func (*Org) GetOrgByDomainAndOrgName

func (o *Org) GetOrgByDomainAndOrgName(domain, orgName string) (*model.Org, error)

Get Org by domain and org name

func (*Org) GetOrgClusterRelationsByOrg added in v1.4.0

func (o *Org) GetOrgClusterRelationsByOrg(orgID uint64) ([]model.OrgClusterRelation, error)

GetOrgClusterRelationsByOrg returns the list of clusters in the organization

func (*Org) List

func (o *Org) List() ([]model.Org, error)

List 获取所有企业列表

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) ListOrgs added in v1.4.0

func (o *Org) ListOrgs(orgIDs []int64, req *apistructs.OrgSearchRequest, all bool) (int, []model.Org, error)

func (*Org) RelateCluster

func (o *Org) RelateCluster(userID string, req *apistructs.OrgClusterRelationCreateRequest) error

RelateCluster 关联集群,创建企业集群关联关系

func (*Org) SearchByName

func (o *Org) SearchByName(name string, pageNo, pageSize int) (int, []model.Org, error)

SearchByName 按企业名称过滤

func (*Org) SearchPublicOrgsByName

func (o *Org) SearchPublicOrgsByName(name string, pageNo, pageSize int) (int, []model.Org, error)

Search public orgs

func (*Org) SetNotifyConfig

func (o *Org) SetNotifyConfig(orgID int64, notifyConfig apistructs.NotifyConfigUpdateRequestBody) error

SetNotifyConfig 设置通知配置

func (*Org) SetReleaseCrossCluster

func (o *Org) SetReleaseCrossCluster(orgID uint64, enable bool) error

SetReleaseCrossCluster 设置企业是否允许跨集群部署开关

func (*Org) Update

func (o *Org) Update(orgID int64, updateReq apistructs.OrgUpdateRequestBody) (*model.Org, apistructs.AuditMessage, error)

Update 更新企业

func (*Org) UpdateWithEvent

func (o *Org) UpdateWithEvent(orgID int64, updateReq apistructs.OrgUpdateRequestBody) (*model.Org, apistructs.AuditMessage, error)

UpdateWithEvent 更新企业 & 发送更新事件

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL