Documentation
¶
Overview ¶
Package parse provides functionality to parse images from collected files.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ComposefileImage ¶
type ComposefileImage struct {
*Image
DockerfilePath string `json:"dockerfile,omitempty"`
Position int `json:"-"`
ServiceName string `json:"service"`
Path string `json:"-"`
Err error `json:"-"`
}
ComposefileImage annotates an image with data about the docker-compose file and/or the Dockerfile from which it was parsed.
type ComposefileImageParser ¶
type ComposefileImageParser struct {
DockerfileImageParser *DockerfileImageParser
}
ComposefileImageParser extracts image values from docker-compose files and Dockerfiles referenced by those docker-compose files.
func NewComposefileImageParser ¶
func NewComposefileImageParser( dockerfileImageParser *DockerfileImageParser, ) (*ComposefileImageParser, error)
NewComposefileImageParser returns a ComposefileImageParser after validating its fields.
func (*ComposefileImageParser) ParseFiles ¶
func (c *ComposefileImageParser) ParseFiles( paths <-chan string, done <-chan struct{}, ) <-chan *ComposefileImage
ParseFiles reads docker-compose YAML to parse all images.
type DockerfileImage ¶
type DockerfileImage struct {
*Image
Position int `json:"-"`
Path string `json:"-"`
Err error `json:"-"`
}
DockerfileImage annotates an image with data about the Dockerfile from which it was parsed.
type DockerfileImageParser ¶
type DockerfileImageParser struct{}
DockerfileImageParser extracts image values from Dockerfiles.
func (*DockerfileImageParser) ParseFiles ¶
func (d *DockerfileImageParser) ParseFiles( paths <-chan string, done <-chan struct{}, ) <-chan *DockerfileImage
ParseFiles reads Dockerfiles to parse all images in FROM instructions.
type IComposefileImageParser ¶
type IComposefileImageParser interface {
ParseFiles(
paths <-chan string,
done <-chan struct{},
) <-chan *ComposefileImage
}
IComposefileImageParser provides an interface for ComposefileImageParser's exported methods.
type IDockerfileImageParser ¶
type IDockerfileImageParser interface {
ParseFiles(
paths <-chan string,
done <-chan struct{},
) <-chan *DockerfileImage
}
IDockerfileImageParser provides an interface for DockerfileImageParser's exported methods.
type IKubernetesfileImageParser ¶ added in v0.7.0
type IKubernetesfileImageParser interface {
ParseFiles(
paths <-chan string,
done <-chan struct{},
) <-chan *KubernetesfileImage
}
IKubernetesfileImageParser provides an interface for KubernetesfileImageParser's exported methods.
type Image ¶
type Image struct {
Name string `json:"name"`
Tag string `json:"tag"`
Digest string `json:"digest"`
}
Image contains information extracted from image lines such as busybox:latest@sha256:dd97a3f... which could be represented as: Image{Name: busybox, Tag: latest, Digest: dd97a3f...}.
type KubernetesfileImage ¶ added in v0.7.0
type KubernetesfileImage struct {
*Image
ContainerName string `json:"container"`
ImagePosition int `json:"-"`
DocPosition int `json:"-"`
Path string `json:"-"`
Err error `json:"-"`
}
KubernetesfileImage annotates an image with data about the Kubernetesfile from which it was parsed.
type KubernetesfileImageParser ¶ added in v0.7.0
type KubernetesfileImageParser struct{}
KubernetesfileImageParser extracts image values from Kubernetesfiles.
func (*KubernetesfileImageParser) ParseFiles ¶ added in v0.7.0
func (k *KubernetesfileImageParser) ParseFiles( paths <-chan string, done <-chan struct{}, ) <-chan *KubernetesfileImage
ParseFiles reads Kubernetesfiles to parse all images.