space

package
v0.0.0-...-6ed4abe Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package space provides bscp space manager.

Index

Constants

This section is empty.

Variables

View Source
var (
	// BCS 项目类型
	BCS = Type{ID: "bcs", Name: "容器项目", EnName: "Container Project"}
	// BK_CMDB cmdb 业务类型
	BK_CMDB = Type{ID: "bkcmdb", Name: "业务", EnName: "Business"}
)

Functions

func BuildSpaceUid

func BuildSpaceUid(t Type, id string) string

BuildSpaceUid 组装 space_uid

Types

type Manager

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

Manager Space定时拉取

func NewSpaceMgr

func NewSpaceMgr(ctx context.Context, client esbcli.Client) (*Manager, error)

NewSpaceMgr 新增Space定时拉取, 注: 每个实例一个 goroutine

func (*Manager) AllCMDBSpaces

func (s *Manager) AllCMDBSpaces() map[string]struct{}

AllCMDBSpaces 返回全量CMDB空间

func (*Manager) AllSpaces

func (s *Manager) AllSpaces() []*Space

AllSpaces 返回全量业务

func (*Manager) GetSpaceByUID

func (s *Manager) GetSpaceByUID(uid string) (*Space, error)

GetSpaceByUID 按id查询业务

func (*Manager) HasCMDBSpace

func (s *Manager) HasCMDBSpace(spaceId string) bool

HasCMDBSpace checks if cmdb space exists

func (*Manager) QuerySpace

func (s *Manager) QuerySpace(spaceUidList []string) ([]*Space, error)

QuerySpace 按uid批量查询业务

type Space

type Space struct {
	SpaceId       string
	SpaceName     string
	SpaceTypeID   string
	SpaceTypeName string
	SpaceUid      string
	SpaceEnName   string
}

Space 空间

type Status

type Status string

Status 空间状态, 预留

const (
	// SpaceNormal 正常状态
	SpaceNormal Status = "normal"
)

type Type

type Type struct {
	ID     string
	Name   string
	EnName string
}

Type 空间类型

Jump to

Keyboard shortcuts

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