Documentation
¶
Index ¶
- func ParseComposeContent(content string) ([]string, error)
- func ParseComposeFile(filePath string) ([]string, error)
- func ParseContent(content string, fileType FileType) ([]string, error)
- func ParseFile(filePath string) ([]string, error)
- func ParseK8sContent(content string) ([]string, error)
- func ParseK8sFile(filePath string) ([]string, error)
- type ComposeConfig
- type FileType
- type K8sResource
- type ServiceConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseComposeContent ¶
ParseComposeContent 解析docker-compose.yaml内容并提取所有镜像
func ParseComposeFile ¶
ParseComposeFile 解析docker-compose.yaml文件并提取所有镜像
func ParseContent ¶
ParseContent 解析YAML内容并提取镜像 根据内容自动判断是docker-compose还是k8s文件
func ParseK8sContent ¶
ParseK8sContent 解析Kubernetes YAML内容并提取所有镜像
func ParseK8sFile ¶
ParseK8sFile 解析Kubernetes YAML文件并提取所有镜像
Types ¶
type ComposeConfig ¶
type ComposeConfig struct {
Version string `yaml:"version"`
Services map[string]ServiceConfig `yaml:"services"`
}
ComposeConfig docker-compose.yaml配置结构
type FileType ¶
type FileType string
FileType YAML文件类型
func DetectFileType ¶
DetectFileType 根据文件路径或内容检测YAML文件类型
type K8sResource ¶
type K8sResource struct {
APIVersion string `yaml:"apiVersion"`
Kind string `yaml:"kind"`
Metadata interface{} `yaml:"metadata"`
Spec interface{} `yaml:"spec"`
}
简化的Kubernetes资源结构
type ServiceConfig ¶
ServiceConfig docker-compose服务配置
Click to show internal directories.
Click to hide internal directories.