bll

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: May 21, 2021 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// TccSettingRecall ...
	TccSettingRecall = "setting.recall"
)

Functions

func MatchChannel added in v0.9.0

func MatchChannel(channels []string, channel string) bool

MatchChannel ...

func MatchClient added in v0.9.0

func MatchClient(clients []string, client string) bool

MatchClient ...

Types

type Blls

type Blls struct {
	User    *User
	Group   *Group
	Product *Product

	Label   *Label
	Module  *Module
	Setting *Setting

	OperationLog *OperationLog
	UrbsAcAcl    *UrbsAcAcl
	UrbsAcUser   *UrbsAcUser
	// contains filtered or unexported fields
}

Blls ...

func NewBlls

func NewBlls(services *service.Services, d *dao.Daos) *Blls

NewBlls ...

func (*Blls) Handler added in v0.6.0

func (a *Blls) Handler(task *tcc.Task)

Handler ...

type Group added in v0.2.0

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

Group ...

func (*Group) AddUserAndOrg added in v0.6.0

func (a *Group) AddUserAndOrg(ctx context.Context, users []string, groups []string)

AddUserAndOrg ...

func (*Group) BatchAdd added in v0.2.0

func (a *Group) BatchAdd(ctx context.Context, groups []tpl.GroupBody) error

BatchAdd ...

func (*Group) BatchAddMember added in v0.2.0

func (a *Group) BatchAddMember(ctx context.Context, kind, uid string) error

BatchAddMember ...

func (*Group) BatchAddMembers added in v0.2.0

func (a *Group) BatchAddMembers(ctx context.Context, kind, uid string, users []string) (*tpl.BoolRes, error)

BatchAddMembers 批量给群组添加成员,如果用户未加入系统,则会自动加入

func (*Group) CheckExists added in v0.2.0

func (a *Group) CheckExists(ctx context.Context, kind, uid string) (*tpl.BoolRes, error)

CheckExists ...

func (*Group) Delete added in v0.2.0

func (a *Group) Delete(ctx context.Context, kind, uid string) (*tpl.BoolRes, error)

Delete ...

func (*Group) List added in v0.2.0

func (a *Group) List(ctx context.Context, args *tpl.GroupsURL) (*tpl.GroupsRes, error)

List ...

func (*Group) ListLables added in v0.2.0

func (a *Group) ListLables(ctx context.Context, args *tpl.GroupPaginationURL) (*tpl.MyLabelsRes, error)

ListLables ...

func (*Group) ListMembers added in v0.2.0

func (a *Group) ListMembers(ctx context.Context, args *tpl.GroupPaginationURL) (*tpl.GroupMembersRes, error)

ListMembers ...

func (*Group) ListSettings added in v0.2.0

func (a *Group) ListSettings(ctx context.Context, args *tpl.MySettingsQueryURL) (*tpl.MySettingsRes, error)

ListSettings ...

func (*Group) RemoveMembers added in v0.2.0

func (a *Group) RemoveMembers(ctx context.Context, args *tpl.GroupMembersURL) (*tpl.BoolRes, error)

RemoveMembers ...

func (*Group) Update added in v0.2.0

func (a *Group) Update(ctx context.Context, kind, uid string, body *tpl.GroupUpdateBody) (*tpl.GroupRes, error)

Update ...

type Label added in v0.2.0

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

Label ...

func (*Label) Assign added in v0.2.0

Assign 把标签批量分配给用户或群组

func (*Label) CleanUp added in v0.6.0

func (a *Label) CleanUp(ctx context.Context, args *tpl.ProductLabelURL) (*tpl.BoolRes, error)

CleanUp ...

func (*Label) Create added in v0.2.0

func (a *Label) Create(ctx context.Context, product string, args *tpl.LabelBody) (*tpl.LabelInfoRes, error)

Create ...

func (*Label) CreateRule added in v0.3.0

func (a *Label) CreateRule(ctx context.Context, args *tpl.ProductLabelURL, body *tpl.LabelRuleBody) (*tpl.LabelRuleInfoRes, error)

CreateRule ...

func (*Label) Delete added in v0.2.0

func (a *Label) Delete(ctx context.Context, product, label string) (*tpl.BoolRes, error)

Delete 物理删除标签

func (*Label) DeleteGroup added in v0.4.0

func (a *Label) DeleteGroup(ctx context.Context, args *tpl.ProductLabelUIDURL) (*tpl.BoolRes, error)

DeleteGroup ...

func (*Label) DeleteRule added in v0.3.0

func (a *Label) DeleteRule(ctx context.Context, args *tpl.ProductLabelHIDURL) (*tpl.BoolRes, error)

DeleteRule ...

func (*Label) DeleteUser added in v0.4.0

func (a *Label) DeleteUser(ctx context.Context, args *tpl.ProductLabelUIDURL) (*tpl.BoolRes, error)

DeleteUser ...

func (*Label) List added in v0.2.0

List 返回产品下的标签列表

func (*Label) ListGroups added in v0.3.0

func (a *Label) ListGroups(ctx context.Context, args *tpl.ProductLabelURL) (*tpl.LabelGroupsInfoRes, error)

ListGroups ...

func (*Label) ListRules added in v0.3.0

func (a *Label) ListRules(ctx context.Context, args *tpl.ProductLabelURL) (*tpl.LabelRulesInfoRes, error)

ListRules ...

func (*Label) ListUsers added in v0.3.0

func (a *Label) ListUsers(ctx context.Context, args *tpl.ProductLabelURL) (*tpl.LabelUsersInfoRes, error)

ListUsers ...

func (*Label) Offline added in v0.2.0

func (a *Label) Offline(ctx context.Context, product, label string) (*tpl.BoolRes, error)

Offline 下线标签

func (*Label) Recall added in v0.3.0

func (a *Label) Recall(ctx context.Context, args *tpl.ProductLabelURL, body *tpl.RecallBody) (*tpl.BoolRes, error)

Recall 批量撤销对用户或群组设置的产品环境标签

func (*Label) Update added in v0.2.0

func (a *Label) Update(ctx context.Context, product, label string, body *tpl.LabelUpdateBody) (*tpl.LabelInfoRes, error)

Update ...

func (*Label) UpdateRule added in v0.3.0

func (a *Label) UpdateRule(ctx context.Context, args *tpl.ProductLabelHIDURL, body *tpl.LabelRuleBody) (*tpl.LabelRuleInfoRes, error)

UpdateRule ...

type Module added in v0.2.0

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

Module ...

func (*Module) Create added in v0.2.0

func (a *Module) Create(ctx context.Context, product string, body *tpl.NameDescBody) (*tpl.ModuleInfoRes, error)

Create 指定产品创建功能模块

func (*Module) List added in v0.2.0

List 读取指定产品的功能模块

func (*Module) Offline added in v0.2.0

func (a *Module) Offline(ctx context.Context, product string, module string) (*tpl.BoolRes, error)

Offline 下线指定产品功能模块

func (*Module) Update added in v0.2.0

func (a *Module) Update(ctx context.Context, product string, module string, body *tpl.ModuleUpdateBody) (*tpl.ModuleInfoRes, error)

Update 更新指定产品功能模块

type OperationLog added in v0.3.0

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

OperationLog table `operation_log`

func (*OperationLog) Add added in v0.3.0

func (a *OperationLog) Add(ctx context.Context, object string, action string, body *dto.OperationLogContent) error

Add ...

func (*OperationLog) AddItem added in v0.6.0

func (a *OperationLog) AddItem(ctx context.Context, obj *operationLogAdd) error

AddItem ...

func (*OperationLog) List added in v0.3.0

List 返回操作日志列表

type Product added in v0.2.0

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

Product ...

func (*Product) Create added in v0.2.0

func (a *Product) Create(ctx context.Context, args *tpl.NameDescBody) (*tpl.ProductRes, error)

Create 创建产品

func (*Product) Delete added in v0.2.0

func (a *Product) Delete(ctx context.Context, product string) (*tpl.BoolRes, error)

Delete 逻辑删除产品

func (*Product) List added in v0.2.0

func (a *Product) List(ctx context.Context, args *tpl.Pagination) (*tpl.ProductsRes, error)

List 返回产品列表

func (*Product) Offline added in v0.2.0

func (a *Product) Offline(ctx context.Context, product string) (*tpl.BoolRes, error)

Offline 下线产品

func (*Product) Statistics added in v0.3.0

func (a *Product) Statistics(ctx context.Context, product string) (*tpl.ProductStatisticsRes, error)

Statistics 返回产品的统计数据

func (*Product) Update added in v0.2.0

func (a *Product) Update(ctx context.Context, product string, body *tpl.ProductUpdateBody) (*tpl.ProductRes, error)

Update ...

type Setting added in v0.2.0

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

Setting ...

func (*Setting) Assign added in v0.2.0

Assign 批量为用户或群组设置产品功能模块配置项

func (*Setting) CleanUp added in v0.6.0

func (a *Setting) CleanUp(ctx context.Context, args *tpl.ProductModuleSettingURL) (*tpl.BoolRes, error)

CleanUp ...

func (*Setting) Create added in v0.2.0

func (a *Setting) Create(ctx context.Context, args *tpl.ProductModuleURL, body *tpl.SettingBody) (*tpl.SettingInfoRes, error)

Create 创建指定产品功能模块配置项

func (*Setting) CreateRule added in v0.3.0

CreateRule ...

func (*Setting) DeleteGroup added in v0.4.0

func (a *Setting) DeleteGroup(ctx context.Context, args *tpl.ProductModuleSettingUIDURL) (*tpl.BoolRes, error)

DeleteGroup ...

func (*Setting) DeleteRule added in v0.3.0

func (a *Setting) DeleteRule(ctx context.Context, args *tpl.ProductModuleSettingHIDURL) (*tpl.BoolRes, error)

DeleteRule ...

func (*Setting) DeleteUser added in v0.4.0

func (a *Setting) DeleteUser(ctx context.Context, args *tpl.ProductModuleSettingUIDURL) (*tpl.BoolRes, error)

DeleteUser ...

func (*Setting) Get added in v0.2.0

Get ...

func (*Setting) List added in v0.2.0

List ...

func (*Setting) ListByProduct added in v0.3.0

func (a *Setting) ListByProduct(ctx context.Context, args *tpl.ProductPaginationURL) (*tpl.SettingsInfoRes, error)

ListByProduct ...

func (*Setting) ListGroups added in v0.3.0

ListGroups ...

func (*Setting) ListRules added in v0.3.0

ListRules ...

func (*Setting) ListUsers added in v0.3.0

ListUsers ...

func (*Setting) Offline added in v0.2.0

func (a *Setting) Offline(ctx context.Context, args *tpl.ProductModuleSettingURL) (*tpl.BoolRes, error)

Offline 下线指定产品功能模块配置项

func (*Setting) Push added in v0.5.0

func (a *Setting) Push(ctx context.Context, event, content string, users []string, groups []*urbssetting.GroupKindUID)

Push ...

func (*Setting) PushAllAsync added in v0.5.0

func (a *Setting) PushAllAsync(ctx context.Context, event string, mySetting *dto.MySetting)

PushAllAsync ...

func (*Setting) PushAsync added in v0.5.0

func (a *Setting) PushAsync(ctx context.Context, event, content string, users []string, groups []*urbssetting.GroupKindUID)

PushAsync ...

func (*Setting) Recall added in v0.3.0

func (a *Setting) Recall(ctx context.Context, args *tpl.ProductModuleSettingURL, body *tpl.RecallBody) (*tpl.BoolRes, error)

Recall ...

func (*Setting) RollbackGroupSetting added in v0.4.0

func (a *Setting) RollbackGroupSetting(ctx context.Context, args *tpl.ProductModuleSettingUIDURL) (*tpl.BoolRes, error)

RollbackGroupSetting ...

func (*Setting) RollbackUserSetting added in v0.4.0

func (a *Setting) RollbackUserSetting(ctx context.Context, args *tpl.ProductModuleSettingUIDURL) (*tpl.BoolRes, error)

RollbackUserSetting ...

func (*Setting) Update added in v0.2.0

Update 更新指定产品功能模块配置项

func (*Setting) UpdateRule added in v0.3.0

UpdateRule ...

type UrbsAcAcl added in v0.3.0

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

UrbsAcAcl ...

func (*UrbsAcAcl) Add added in v0.3.0

func (a *UrbsAcAcl) Add(ctx context.Context, subject string, object string, permission string) error

Add ...

func (*UrbsAcAcl) AddByReq added in v0.3.0

func (a *UrbsAcAcl) AddByReq(ctx context.Context, args *tpl.UrbsAcAclURL, req *tpl.UrbsAcAclAddBody) error

AddByReq ...

func (*UrbsAcAcl) Check added in v0.3.0

func (a *UrbsAcAcl) Check(ctx context.Context, object string, permission string) error

Check ...

func (*UrbsAcAcl) CheckAdmin added in v0.3.0

func (a *UrbsAcAcl) CheckAdmin(ctx context.Context, object string) error

CheckAdmin ...

func (*UrbsAcAcl) CheckSuperAdmin added in v0.3.0

func (a *UrbsAcAcl) CheckSuperAdmin(ctx context.Context) error

CheckSuperAdmin ...

func (*UrbsAcAcl) CheckViewer added in v0.3.0

func (a *UrbsAcAcl) CheckViewer(ctx context.Context) error

CheckViewer ...

func (*UrbsAcAcl) Delete added in v0.4.0

func (a *UrbsAcAcl) Delete(ctx context.Context, args *tpl.UrbsAcAclURL, req *tpl.UrbsAcAclAddBody) error

Delete ...

func (*UrbsAcAcl) FindOne added in v0.3.0

func (a *UrbsAcAcl) FindOne(ctx context.Context, subject, object, permission string) (*schema.UrbsAcAcl, error)

FindOne ...

func (*UrbsAcAcl) FindUsersByObject added in v0.3.0

func (a *UrbsAcAcl) FindUsersByObject(ctx context.Context, object string) ([]*tpl.User, error)

FindUsersByObject ...

func (*UrbsAcAcl) FindUsersByObjects added in v0.3.0

func (a *UrbsAcAcl) FindUsersByObjects(ctx context.Context, objects []string) (map[string][]*tpl.User, error)

FindUsersByObjects ...

func (*UrbsAcAcl) Update added in v0.3.0

func (a *UrbsAcAcl) Update(ctx context.Context, body *tpl.UidsBody, object string) error

Update ...

type UrbsAcUser added in v0.3.0

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

UrbsAcUser ...

func (*UrbsAcUser) Add added in v0.3.0

func (a *UrbsAcUser) Add(ctx context.Context, body *tpl.UrbsAcUsersBody) error

Add ...

func (*UrbsAcUser) DeleteByUID added in v0.4.0

func (a *UrbsAcUser) DeleteByUID(ctx context.Context, uid string) error

DeleteByUID ...

func (*UrbsAcUser) List added in v0.3.0

List 返回用户列表

func (*UrbsAcUser) Search added in v0.3.0

func (a *UrbsAcUser) Search(ctx context.Context, key string) (*tpl.UrbsAcUserListRes, error)

Search ...

func (*UrbsAcUser) UpdateByUID added in v0.4.0

func (a *UrbsAcUser) UpdateByUID(ctx context.Context, name, uid string) error

UpdateByUID ...

type User added in v0.2.0

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

User ...

func (*User) ApplyRules added in v0.10.0

func (a *User) ApplyRules(ctx context.Context, product string, body *tpl.ApplyRulesBody) (*tpl.BoolRes, error)

ApplyRules ...

func (*User) BatchAdd added in v0.2.0

func (a *User) BatchAdd(ctx context.Context, users []string) (*tpl.BoolRes, error)

BatchAdd 批量添加用户

func (*User) CheckExists added in v0.2.0

func (a *User) CheckExists(ctx context.Context, uid string) (*tpl.BoolRes, error)

CheckExists ...

func (*User) List added in v0.3.0

func (a *User) List(ctx context.Context, args *tpl.Pagination) (*tpl.UsersRes, error)

List ...

func (*User) ListLables added in v0.2.0

func (a *User) ListLables(ctx context.Context, args *tpl.UIDPaginationURL) (*tpl.MyLabelsRes, error)

ListLables ...

func (*User) ListSettings added in v0.2.0

func (a *User) ListSettings(ctx context.Context, args *tpl.UIDPaginationURL) (*tpl.MySettingsRes, error)

ListSettings ...

func (*User) ListSettingsUnionAll added in v0.2.0

func (a *User) ListSettingsUnionAll(ctx *gear.Context, args *tpl.MySettingsQueryURL) (*tpl.MySettingsRes, error)

ListSettingsUnionAll ...

func (*User) RefreshCachedLables added in v0.2.0

func (a *User) RefreshCachedLables(ctx context.Context, uid string) (*tpl.UserRes, error)

RefreshCachedLables ...

Jump to

Keyboard shortcuts

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