labels

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2018 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DEPENDENCY the dependencies tag
	DEPENDENCY = "DEPENDENCY"

	// ENVS the environment variables tag
	ENVS = "ENVS"

	// EXPOSED the exposed ports tag
	EXPOSED = "EXPOSED"

	// RESOURCES the used resources tag
	RESOURCES = "RESOURCES"

	// TAGS the extra tags used for our images
	TAGS = "TAGS"

	//COMMAND_TESTS command tests
	COMMAND_TESTS = "COMMAND_TESTS"

	//FILE_EXISTENCE_TESTS file existence tests
	FILE_EXISTENCE_TESTS = "FILE_EXISTENCE_TESTS"

	//FILE_CONTENT_TESTS file content tests
	FILE_CONTENT_TESTS = "FILE_CONTENT_TESTS"

	//METADATA_TESTS meta data tests
	METADATA_TESTS = "METADATA_TESTS"
)

Variables

This section is empty.

Functions

func GetImageLabels added in v0.2.0

func GetImageLabels(imageName string) (map[string]string, error)

GetImageLabels asds

func ImageExists added in v0.2.0

func ImageExists(imageName string) bool

ImageExists checks if a certain image exists in the local repo

Types

type CommandTest added in v0.2.0

type CommandTest struct {
	Name           string   `json:"name,omitempty"`
	Command        string   `json:"command,omitempty"`
	Setup          string   `json:"setup,omitempty"`
	Args           []string `json:"args,omitempty"`
	About          string   `json:"about,omitempty"`
	ExpectedOutput string   `json:"expectedOutput,omitempty"`
	ExpectedError  string   `json:"expectedError,omitempty"`
	ExcludedOutput string   `json:"excludedOutput,omitempty"`
	ExcludedError  string   `json:"excludedError,omitempty"`
}

CommandTest a command container structure test

type CommandTests added in v0.2.0

type CommandTests []CommandTest

CommandTests array of command tests objects

func GetCommandTests added in v0.2.0

func GetCommandTests(dockerfile string) (*CommandTests, error)

GetCommandTests fetch the command tests from the Dockerfile

func GetImageCommandTests added in v0.2.0

func GetImageCommandTests(imageName string) (*CommandTests, error)

GetImageCommandTests fetch the command tests from the container image

type Dependencies

type Dependencies []Dependency

Dependencies array of dependency objects

func GetDepenedencies

func GetDepenedencies(dockerfile string) (*Dependencies, error)

GetDepenedencies fetch the container dependencies from the Dockerfile

func GetImageDepenedencies added in v0.2.0

func GetImageDepenedencies(imageName string) (*Dependencies, error)

GetImageDepenedencies fetch the container dependencies from the Dockerfile

type Dependency

type Dependency struct {
	Name      string   `json:"name,omitempty"`
	Image     string   `json:"image,omitempty"`
	Ports     []string `json:"ports,omitempty"`
	About     string   `json:"about,omitempty"`
	Mandatory string   `json:"mandatory,omitempty"`
}

Dependency object for the Dockerfile

type Env

type Env struct {
	Name      string `json:"name,omitempty"`
	About     string `json:"about,omitempty"`
	Mandatory string `json:"mandatory,omitempty"`
}

Env is the Environment Variable object for the Dockerfile

type Envs

type Envs []Env

Envs array of environment variable objects

func GetEnvs

func GetEnvs(dockerfile string) (*Envs, error)

GetEnvs fetch cotnainer environment variables from the Dockerfile

func GetImageEnvs added in v0.2.0

func GetImageEnvs(imageName string) (*Envs, error)

GetImageEnvs fetch cotnainer environment variables from the docker image

type FileContentTest added in v0.2.0

type FileContentTest struct {
	Name             string `json:"name,omitempty"`
	Path             string `json:"path,omitempty"`
	ExpectedContents string `json:"expectedContents,omitempty"`
	ExcludedContents string `json:"excludedContents,omitempty"`
}

FileContentTest a file content container structure test

type FileContentTests added in v0.2.0

type FileContentTests []FileContentTest

FileContentTests array of file existence test objects

func GetFileContentTests added in v0.2.0

func GetFileContentTests(dockerfile string) (*FileContentTests, error)

GetFileContentTests fetches the me

func GetImageFileContentTests added in v0.2.0

func GetImageFileContentTests(imageName string) (*FileContentTests, error)

GetImageFileContentTests fetches the me

type FileExistenceTest added in v0.2.0

type FileExistenceTest struct {
	Name        string `json:"name,omitempty"`
	Path        string `json:"path,omitempty"`
	ShouldExist string `json:"shouldExist,omitempty"`
	Permissions string `json:"permissions,omitempty"`
}

FileExistenceTest a file content container structure test

type FileExistenceTests added in v0.2.0

type FileExistenceTests []FileExistenceTest

FileExistenceTests array of file exsistence tests

func GetFileExistenceTests added in v0.2.0

func GetFileExistenceTests(dockerfile string) (*FileExistenceTests, error)

GetFileExistenceTests fetch the container file existence tests from the Dockerfile

func GetImageFileExistenceTests added in v0.2.0

func GetImageFileExistenceTests(imageName string) (*FileExistenceTests, error)

GetImageFileExistenceTests fetch the container file existence tests from the container Image

type MetadataTest added in v0.2.0

type MetadataTest struct {
	Env          string `json:"env,omitempty"`
	ExposedPorts string `json:"exposedPorts,omitempty"`
	Volumes      string `json:"volumes,omitempty"`
	EntryPoint   string `json:"entrypoint,omitempty"`
	Cmd          string `json:"cmd,omitempty"`
	Workdir      string `json:"workdir,omitempty"`
}

MetadataTest a test to make sure important meta-data exists in the container

type MetadataTests added in v0.2.0

type MetadataTests []MetadataTest

MetadataTests array of metadata tests

func GetImageMetadataTests added in v0.2.0

func GetImageMetadataTests(imageName string) (*MetadataTests, error)

GetImageMetadataTests fetches the image metadata tests from the container image

func GetMetadataTests added in v0.2.0

func GetMetadataTests(dockerfile string) (*MetadataTests, error)

GetMetadataTests fetches the me

type Others

type Others map[string]string

Others all other tags regardless of their type in the dockerfile

func GetOtherImageTags added in v0.2.0

func GetOtherImageTags(imageName string) (*Others, error)

GetOtherImageTags gets all the docker image labels

func GetOtherTags

func GetOtherTags(dockerfile string) (*Others, error)

GetOtherTags gets all the dockerfile labels

type Port

type Port struct {
	Name     string `json:"name,omitempty"`
	About    string `json:"about,omitempty"`
	Scheme   string `json:"scheme,omitempty"`
	Protocol string `json:"protocol,omitempty"`
}

Port is the exposed port object for the Dockerfile

type Ports

type Ports []Port

Ports that should be exposed by the container application

func GetExposedPorts

func GetExposedPorts(dockerfile string) (*Ports, error)

GetExposedPorts fetch the texposed ports from the Dockerfile

func GetImageExposedPorts added in v0.2.0

func GetImageExposedPorts(imageName string) (*Ports, error)

GetImageExposedPorts fetch the texposed ports from the docker image

type Resources

type Resources struct {
	CPU    string `json:"cpu,omitempty"`
	Memory string `json:"memory,omitempty"`
}

Resources is the exposed port object for the Dockerfile (only one resource object per dockerfile )

func GetImageResources added in v0.2.0

func GetImageResources(imageName string) (*Resources, error)

GetImageResources fetch the container resources from the docker image

func GetResources

func GetResources(dockerfile string) (*Resources, error)

GetResources fetch the container resources from the Dockerfile

type Tags

type Tags map[string]string

Tags tags from dockerfile

func GetImageTags added in v0.2.0

func GetImageTags(imageName string) (*Tags, error)

GetImageTags fetch the tags used in the docker image

func GetTags

func GetTags(dockerfile string) (*Tags, error)

GetTags fetch the tags used in the Dockerfile

Jump to

Keyboard shortcuts

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