Documentation
¶
Index ¶
- func Chart(b []byte, logger *logrus.Logger) error
- func GetResult(b []byte, logger *logrus.Logger, cmd string) ([]runner.ShellResult, error)
- func HarborImageList(b []byte, logger *logrus.Logger) error
- func Item(b []byte, logger *logrus.Logger, cmd string) error
- func LocalImageList()
- type Artifact
- type ChartExecutor
- type ChartItem
- type ChartRepoConfig
- type HarborConfig
- type HarborConfigExternel
- type HarborExecutor
- func (executor *HarborExecutor) AllProjects() error
- func (executor *HarborExecutor) FilterProjects() error
- func (executor *HarborExecutor) GenerateImageList() error
- func (executor *HarborExecutor) ListRepoByPage(page int, projectName string) ([]Repository, error)
- func (executor *HarborExecutor) ProjectList() error
- func (executor *HarborExecutor) ProjectsByName(projectName string) (ProjectInternel, error)
- func (executor *HarborExecutor) ProjectsByNames(projectsName []string) error
- func (executor *HarborExecutor) ProjectsByPage(page int) ([]ProjectInternel, error)
- func (executor *HarborExecutor) ReposWithinProject(projectName string) error
- func (executor *HarborExecutor) ReposWithinProjects() error
- func (executor *HarborExecutor) TagsWithinProject(projectName string) ([]string, error)
- func (executor *HarborExecutor) TagsWithinProjects() error
- func (executor *HarborExecutor) TagsWithinRepo(projectName string, repoName string) ([]string, error)
- func (executor *HarborExecutor) TagsWithinRepoByPage(page int, projectName string, repoName string) ([]string, error)
- type HelmRepo
- type ProjectExternel
- type ProjectInternel
- type Repository
- type SearchResult
- type TagExternel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HarborImageList ¶
HarborImageList harbor镜像列表导出
func LocalImageList ¶
func LocalImageList()
Types ¶
type Artifact ¶
type Artifact struct {
AdditionLinks struct {
BuildHistory struct {
Absolute bool `json:"absolute"`
Href string `json:"href"`
} `json:"build_history"`
Vulnerabilities struct {
Absolute bool `json:"absolute"`
Href string `json:"href"`
} `json:"vulnerabilities"`
} `json:"addition_links"`
Digest string `json:"digest"`
ExtraAttrs struct {
Architecture string `json:"architecture"`
Author interface{} `json:"author"`
Created time.Time `json:"created"`
Os string `json:"os"`
} `json:"extra_attrs"`
Icon string `json:"icon"`
Id int `json:"id"`
Labels interface{} `json:"labels"`
ManifestMediaType string `json:"manifest_media_type"`
MediaType string `json:"media_type"`
ProjectId int `json:"project_id"`
PullTime time.Time `json:"pull_time"`
PushTime time.Time `json:"push_time"`
References interface{} `json:"references"`
RepositoryId int `json:"repository_id"`
Size int `json:"size"`
Tags []TagExternel `json:"tags"`
Type string `json:"type"`
}
type ChartExecutor ¶
type ChartExecutor struct {
Config ChartRepoConfig
Logger *logrus.Logger
}
func (ChartExecutor) ChartList ¶
func (executor ChartExecutor) ChartList() ([]ChartItem, error)
ChartList 获取chart列表
type ChartRepoConfig ¶
type ChartRepoConfig struct {
HelmRepo HelmRepo `yaml:"helm-Repository"`
}
ChartRepoConfig chart仓库实体
func ParseHelmRepoConfig ¶
func ParseHelmRepoConfig(b []byte, logger *logrus.Logger) (ChartRepoConfig, error)
type HarborConfig ¶
type HarborConfigExternel ¶
type HarborConfigExternel struct {
HarborRepo struct {
Schema string `yaml:"schema"`
Address string `yaml:"address"`
Domain string `yaml:"domain"`
User string `yaml:"user"`
Password string `yaml:"password"`
PreserveDir string `yaml:"preserve-dir"`
Projects []string `yaml:"projects"`
Excludes []string `yaml:"excludes"`
} `yaml:"harbor-repo"`
}
type HarborExecutor ¶
type HarborExecutor struct {
HarborConfig HarborConfig
Logger *logrus.Logger
ProjectSlice []ProjectInternel
ReposInProject map[string][]string // 项目下镜像repo集合
TagsInProject map[string][]string // 项目下镜像tag集合
}
func ParseHarborConfig ¶
func ParseHarborConfig(b []byte, logger *logrus.Logger) (*HarborExecutor, error)
func (*HarborExecutor) AllProjects ¶
func (executor *HarborExecutor) AllProjects() error
AllProjects 获取harbor所有projects
func (*HarborExecutor) FilterProjects ¶
func (executor *HarborExecutor) FilterProjects() error
FilterProjects 过滤排除的project
func (*HarborExecutor) GenerateImageList ¶
func (executor *HarborExecutor) GenerateImageList() error
GenerateImageList 生成文件
func (*HarborExecutor) ListRepoByPage ¶
func (executor *HarborExecutor) ListRepoByPage(page int, projectName string) ([]Repository, error)
ListRepoByPage 调用harbor api获取project列表,根据project name获取repo列表
func (*HarborExecutor) ProjectList ¶
func (executor *HarborExecutor) ProjectList() error
ProjectList 获取所有projects
func (*HarborExecutor) ProjectsByName ¶
func (executor *HarborExecutor) ProjectsByName(projectName string) (ProjectInternel, error)
ProjectsByName 按名称获取harbor内的项目
func (*HarborExecutor) ProjectsByNames ¶
func (executor *HarborExecutor) ProjectsByNames(projectsName []string) error
ProjectsByNames 按名称集合获取harbor内的项目
func (*HarborExecutor) ProjectsByPage ¶
func (executor *HarborExecutor) ProjectsByPage(page int) ([]ProjectInternel, error)
ProjectsByPage 按页查询harbor内project
func (*HarborExecutor) ReposWithinProject ¶
func (executor *HarborExecutor) ReposWithinProject(projectName string) error
ReposWithinProject 获取项目下repo列表
func (*HarborExecutor) ReposWithinProjects ¶
func (executor *HarborExecutor) ReposWithinProjects() error
func (*HarborExecutor) TagsWithinProject ¶
func (executor *HarborExecutor) TagsWithinProject(projectName string) ([]string, error)
TagsWithinProject 按`project name + Repository name`查询所有镜像tag
func (*HarborExecutor) TagsWithinProjects ¶
func (executor *HarborExecutor) TagsWithinProjects() error
func (*HarborExecutor) TagsWithinRepo ¶
func (executor *HarborExecutor) TagsWithinRepo(projectName string, repoName string) ([]string, error)
TagsWithinRepo 按`project name + Repository name`查询所有镜像tag
func (*HarborExecutor) TagsWithinRepoByPage ¶
func (executor *HarborExecutor) TagsWithinRepoByPage(page int, projectName string, repoName string) ([]string, error)
TagsWithinRepoByPage 获取repo的全部tag
type ProjectExternel ¶
type ProjectExternel struct {
CreationTime time.Time `json:"creation_time"`
CurrentUserRoleId int `json:"current_user_role_id"`
CurrentUserRoleIds []int `json:"current_user_role_ids"`
CveAllowlist struct {
CreationTime time.Time `json:"creation_time"`
Id int `json:"id"`
Items []interface{} `json:"items"`
ProjectId int `json:"project_id"`
UpdateTime time.Time `json:"update_time"`
} `json:"cve_allowlist"`
Metadata struct {
Public string `json:"public"`
RetentionId string `json:"retention_id,omitempty"`
AutoScan string `json:"auto_scan,omitempty"`
EnableContentTrust string `json:"enable_content_trust,omitempty"`
PreventVul string `json:"prevent_vul,omitempty"`
ReuseSysCveAllowlist string `json:"reuse_sys_cve_allowlist,omitempty"`
Severity string `json:"severity,omitempty"`
} `json:"metadata"`
Name string `json:"name"`
OwnerId int `json:"owner_id"`
OwnerName string `json:"owner_name"`
ProjectId int `json:"project_id"`
RepoCount int `json:"repo_count,omitempty"`
UpdateTime time.Time `json:"update_time"`
ChartCount int `json:"chart_count,omitempty"`
}
type ProjectInternel ¶
type Repository ¶
type Repository struct {
Name string `json:"name"`
}
type SearchResult ¶
type SearchResult struct {
Project []ProjectExternel `json:"project"`
Repository []struct {
} `json:"repository"`
Chart []struct {
Name string `json:"Name"`
Score int `json:"Score"`
Chart struct {
Name string `json:"name"`
Version string `json:"version"`
Description string `json:"description"`
ApiVersion string `json:"apiVersion"`
AppVersion string `json:"appVersion"`
Type string `json:"type"`
Urls []string `json:"urls"`
Created time.Time `json:"created"`
Digest string `json:"digest"`
} `json:"Chart"`
} `json:"chart"`
}
type TagExternel ¶
Click to show internal directories.
Click to hide internal directories.