Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CloudAccountDAO ¶ added in v0.0.16
type CloudAccountDAO interface {
Create(ctx context.Context, account *model.CloudAccount) error
Update(ctx context.Context, account *model.CloudAccount) error
Delete(ctx context.Context, id int) error
GetByID(ctx context.Context, id int) (*model.CloudAccount, error)
GetList(ctx context.Context, req *model.GetCloudAccountListReq) ([]*model.CloudAccount, int64, error)
UpdateStatus(ctx context.Context, id int, status model.CloudAccountStatus) error
GetByProviderAndRegion(ctx context.Context, provider model.CloudProvider, region string) ([]*model.CloudAccount, error)
}
func NewCloudAccountDAO ¶ added in v0.0.16
func NewCloudAccountDAO(db *gorm.DB, logger *zap.Logger) CloudAccountDAO
type TreeCloudDAO ¶ added in v0.0.16
type TreeCloudDAO interface {
Create(ctx context.Context, cloud *model.TreeCloudResource) error
Update(ctx context.Context, cloud *model.TreeCloudResource) error
UpdateMetadata(ctx context.Context, id int, metadata map[string]interface{}) error
Delete(ctx context.Context, id int) error
GetByID(ctx context.Context, id int) (*model.TreeCloudResource, error)
GetList(ctx context.Context, req *model.GetTreeCloudResourceListReq) ([]*model.TreeCloudResource, int64, error)
GetByAccountAndInstanceID(ctx context.Context, cloudAccountID int, instanceID string) (*model.TreeCloudResource, error)
GetByNodeID(ctx context.Context, nodeID int, req *model.GetTreeNodeCloudResourcesReq) ([]*model.TreeCloudResource, error)
BindTreeNodes(ctx context.Context, cloudID int, treeNodeIds []int) error
UnBindTreeNodes(ctx context.Context, cloudID int, treeNodeIds []int) error
BatchGetByIDs(ctx context.Context, ids []int) ([]*model.TreeCloudResource, error)
BatchCreate(ctx context.Context, clouds []*model.TreeCloudResource) error
UpdateStatus(ctx context.Context, id int, status model.CloudResourceStatus) error
CreateSyncHistory(ctx context.Context, history *model.CloudResourceSyncHistory) error
GetSyncHistoryList(ctx context.Context, req *model.GetCloudResourceSyncHistoryReq) ([]*model.CloudResourceSyncHistory, int64, error)
CreateChangeLog(ctx context.Context, log *model.CloudResourceChangeLog) error
GetChangeLogList(ctx context.Context, req *model.GetCloudResourceChangeLogReq) ([]*model.CloudResourceChangeLog, int64, error)
}
func NewTreeCloudDAO ¶ added in v0.0.16
func NewTreeCloudDAO(db *gorm.DB, logger *zap.Logger) TreeCloudDAO
type TreeLocalDAO ¶
type TreeLocalDAO interface {
Create(ctx context.Context, local *model.TreeLocalResource) error
Update(ctx context.Context, local *model.TreeLocalResource) error
Delete(ctx context.Context, id int) error
GetByID(ctx context.Context, id int) (*model.TreeLocalResource, error)
GetList(ctx context.Context, req *model.GetTreeLocalResourceListReq) ([]*model.TreeLocalResource, int64, error)
GetByIP(ctx context.Context, ip string) (*model.TreeLocalResource, error)
BindTreeNodes(ctx context.Context, localID int, treeNodeIds []int) error
UnBindTreeNodes(ctx context.Context, localID int, treeNodeIds []int) error
BatchGetByIDs(ctx context.Context, ids []int) ([]*model.TreeLocalResource, error)
}
func NewTreeLocalDAO ¶
func NewTreeLocalDAO(db *gorm.DB, logger *zap.Logger) TreeLocalDAO
type TreeNodeDAO ¶
type TreeNodeDAO interface {
// 基础查询方法
GetTreeList(ctx context.Context, req *model.GetTreeNodeListReq) ([]*model.TreeNode, int64, error)
GetNode(ctx context.Context, id int) (*model.TreeNode, error)
GetChildNodes(ctx context.Context, parentID int) ([]*model.TreeNode, error)
GetTreeStatistics(ctx context.Context) (*model.TreeNodeStatisticsResp, error)
// 节点管理方法
CreateNode(ctx context.Context, node *model.TreeNode) error
UpdateNode(ctx context.Context, node *model.TreeNode) error
DeleteNode(ctx context.Context, id int) error
// 资源管理方法
BindResource(ctx context.Context, nodeId int, resourceIds []int) error
UnbindResource(ctx context.Context, nodeId int, resourceId int) error
// 成员管理方法
GetNodeMembers(ctx context.Context, nodeId int, memberType string) ([]*model.User, error)
AddNodeMember(ctx context.Context, nodeId int, userId int, memberType model.TreeNodeMemberType) error
RemoveNodeMember(ctx context.Context, nodeId int, userId int, memberType model.TreeNodeMemberType) error
}
func NewTreeNodeDAO ¶
func NewTreeNodeDAO(logger *zap.Logger, db *gorm.DB) TreeNodeDAO
Click to show internal directories.
Click to hide internal directories.