Documentation
¶
Index ¶
- Variables
- func CreateHarborProject(name, url, username, passwd string) error
- func DockerBuildx(args ...string) error
- func DockerLogin(url, username, password string) error
- func GetDockerPasswdByConfig(r string, cf io.Reader) (user, passwd string, err error)
- func GetDockerPassword(url string) (username, passwd string, err error)
- func GetDockerPasswordFromCache(url string) (username, passwd string, err error)
- func GetLoginToken(url string, username string, passwd string) (string, error)
- func SelfCheckBuildX() error
- func SelfCheckDocker() error
- func SelfCheckSkopeo() error
- func SkopeoCopy(src, dst string, args ...string) error
- func SkopeoInspect(img string, args ...string) (string, error)
- func SkopeoLogin(url, username, password string) error
- type DockerCredDesktopOutput
- type DockerPasswordCache
- type HarborProjectMetadataTemplate
- type HarborProjectTemplate
Constants ¶
This section is empty.
Variables ¶
var ( DockerPath = "docker" SkopeoPath = "skopeo" )
var RunCommandFunc u.RunCmdFuncType = nil
RunCommandFunc specifies the custom function to run command for registry.
Only used for testing purpose!
Functions ¶
func CreateHarborProject ¶
CreateHarborProject creates project for harbor v2
func DockerBuildx ¶
DockerBuildx executes 'docker buildx args...' command
func DockerLogin ¶
DockerLogin executes 'docker login <registry> --username=<user> --password-stdin'
func GetDockerPasswdByConfig ¶
func GetDockerPassword ¶
GetDockerPassword will try to find docker password from cache, if not found, it will try to find password from docker config. if passwd found in docker config, it will cache the password. if not found, return error
func GetDockerPasswordFromCache ¶
GetDockerPasswordFromCache gets docker password from cache
func SelfCheckBuildX ¶
func SelfCheckBuildX() error
func SelfCheckDocker ¶
func SelfCheckDocker() error
func SelfCheckSkopeo ¶
func SelfCheckSkopeo() error
SelfCheck checks the registry related commands is installed or not
func SkopeoCopy ¶
SkopeoCopy execute the `skopeo copy ${source} ${destination} args...` cmd You can add custom parameters in `args`
func SkopeoInspect ¶
InspectRaw function executs `skopeo inspect ${img}` command and return the output if execute successfully
func SkopeoLogin ¶ added in v1.5.0
SkopeoLogin executes 'skopeo login <registry> --username=<user> --password-stdin'
Types ¶
type DockerCredDesktopOutput ¶
type DockerPasswordCache ¶
type HarborProjectMetadataTemplate ¶
type HarborProjectMetadataTemplate struct {
Public string `json:"public"`
}
type HarborProjectTemplate ¶
type HarborProjectTemplate struct { ProjectName string `json:"project_name"` Metadata HarborProjectMetadataTemplate `json:"metadata"` }