generate

package
v0.6.5 Latest Latest
Warning

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

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

Documentation

Overview

Package generate provides the "generate" command.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultConfigPath

func DefaultConfigPath() string

DefaultConfigPath returns the default location of docker's config.json for all platforms.

func DefaultImageDigestUpdater

func DefaultImageDigestUpdater(
	client *registry.HTTPClient,
	flags *Flags,
) (generate.IImageDigestUpdater, error)

DefaultImageDigestUpdater creates an ImageDigestUpdater for Generator.

func DefaultImageParser

func DefaultImageParser(flags *Flags) (generate.IImageParser, error)

DefaultImageParser creates an ImageParser for Generator.

func DefaultLoadEnv

func DefaultLoadEnv(path string) error

DefaultLoadEnv loads .env files based on the path. If a path does not exist and that path is not ".env", an error will occur.

func DefaultPathCollector

func DefaultPathCollector(flags *Flags) (generate.IPathCollector, error)

DefaultPathCollector creates a PathCollector for Generator.

func DefaultWrapperManager

func DefaultWrapperManager(
	client *registry.HTTPClient,
	configPath string,
) (*registry.WrapperManager, error)

DefaultWrapperManager creates a WrapperManager with all possible Wrappers, the default being the docker wrapper.

func NewGenerateCmd

func NewGenerateCmd(client *registry.HTTPClient) (*cobra.Command, error)

NewGenerateCmd creates the command 'generate' used in 'docker lock generate'.

func SetupGenerator

func SetupGenerator(
	client *registry.HTTPClient,
	flags *Flags,
) (*generate.Generator, error)

SetupGenerator creates a Generator configured for docker-lock's cli.

Types

type Flags

type Flags struct {
	FlagsWithSharedValues *FlagsWithSharedValues
	DockerfileFlags       *FlagsWithSharedNames
	ComposefileFlags      *FlagsWithSharedNames
}

Flags holds all values needed for the components that comprise a Generator.

func NewFlags

func NewFlags(
	baseDir string,
	lockfileName string,
	configPath string,
	envPath string,
	ignoreMissingDigests bool,
	dockerfilePaths []string,
	composefilePaths []string,
	dockerfileGlobs []string,
	composefileGlobs []string,
	dockerfileRecursive bool,
	composefileRecursive bool,
	dockerfileExcludeAll bool,
	composefileExcludeAll bool,
) (*Flags, error)

NewFlags returns Flags used by Generator for Dockerfiles and docker-compose files.

type FlagsWithSharedNames

type FlagsWithSharedNames struct {
	ManualPaths  []string
	Globs        []string
	Recursive    bool
	ExcludePaths bool
}

FlagsWithSharedNames represents flags whose values differ for DockerfileParser and ComposefileParser.

func NewFlagsWithSharedNames

func NewFlagsWithSharedNames(
	baseDir string,
	manualPaths []string,
	globs []string,
	recursive bool,
	excludePaths bool,
) (*FlagsWithSharedNames, error)

NewFlagsWithSharedNames returns NewFlagsWithSharedNames after validating its fields.

type FlagsWithSharedValues

type FlagsWithSharedValues struct {
	BaseDir              string
	LockfileName         string
	ConfigPath           string
	EnvPath              string
	IgnoreMissingDigests bool
}

FlagsWithSharedValues represents flags whose values are the same for DockerfileParser and ComposefileParser.

func NewFlagsWithSharedValues

func NewFlagsWithSharedValues(
	baseDir string,
	lockfileName string,
	configPath string,
	envPath string,
	ignoreMissingDigests bool,
) (*FlagsWithSharedValues, error)

NewFlagsWithSharedValues returns NewFlagsWithSharedValues after validating its fields.

Jump to

Keyboard shortcuts

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