parse

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

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 referenced services.

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 a Dockerfile 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 Image

type Image struct {
	Name   string `json:"name"`
	Tag    string `json:"tag"`
	Digest string `json:"digest"`
}

Image contains information extracted from 'FROM' instructions in Dockerfiles or 'image:' keys in docker-compose files. For instance, FROM busybox:latest@sha256:dd97a3f... could be represented as: Image{Name: busybox, Tag: latest, Digest: dd97a3f...}.

Jump to

Keyboard shortcuts

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