Documentation ¶
Index ¶
- type CommandSequence
- type InstructionSet
- type Parser
- func (parser *Parser) AssertLint()
- func (parser *Parser) IsOpenable() bool
- func (parser *Parser) Lint() error
- func (parser *Parser) NextUUID() (string, error)
- func (parser *Parser) Parse() (*CommandSequence, error)
- func (parser *Parser) RandomizeUUIDGenerator()
- func (parser *Parser) SeedUUIDGenerator()
- type SubSequence
- type SubSequenceMetadata
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommandSequence ¶
type CommandSequence struct {
Commands []*SubSequence
}
A CommandSequence is an intermediate data type in the parsing process. Once a Builderfile is parsed into an InstructionSet, it is further parsed into a CommandSequence, which is essential an array of strings where each string is a command to be run.
type InstructionSet ¶
type InstructionSet struct { DockerBuildOpts []string DockerTagOpts []string Containers map[string]builderfile.ContainerSection }
An InstructionSet is an intermediate datatype - once a Builderfile is parsed and the TOML is validated, the parser parses the data into an InstructionSet. The primary purpose of this step is to merge any global container options into the sections for the individual containers.
type Parser ¶
Parser is a struct that contains a Builderfile and knows how to parse it both as raw text and to convert toml to a Builderfile struct. It also knows how to tell if the Builderfile is valid (openable) or nat.
func NewParser ¶
NewParser returns an initialized Parser. Not currently necessary, as no default values are assigned to a new Parser, but useful to have in case we need to change this.
func (*Parser) AssertLint ¶
func (parser *Parser) AssertLint()
AssertLint is like Lint except that instead of returning an nil/error to indicate success/failure, it exits nonzero if linting fails.
func (*Parser) IsOpenable ¶
IsOpenable examines the Builderfile provided to the Parser and returns a bool indicating whether or not the file exists and openable.
func (*Parser) Lint ¶
Lint parses a builderfile and returns either nil if the file was parsed successfully or an error indicating that parsing failed and the file is invalid.
func (*Parser) NextUUID ¶
NextUUID returns the next UUID generated by the parser's uuid generator. This will either be a random uuid (normal behavior) or the same uuid every time if the generator is "seeded" (used for tests)
func (*Parser) Parse ¶
func (parser *Parser) Parse() (*CommandSequence, error)
Parse further parses the Builderfile struct into an InstructionSet struct, merging the global container options into the individual container sections.
func (*Parser) RandomizeUUIDGenerator ¶
func (parser *Parser) RandomizeUUIDGenerator()
RandomizeUUIDGenerator turns this parser's uuidGenerator into a random generator. All calls to NextUUID() will produce a random uuid after this function is called and until SeedUUIDGenerator() is called.
func (*Parser) SeedUUIDGenerator ¶
func (parser *Parser) SeedUUIDGenerator()
SeedUUIDGenerator turns this parser's uuidGenerator into a seeded generator. All calls to NextUUID() will produce the same uuid after this function is called and until RandomizeUUIDGenerator() is called.
type SubSequence ¶
type SubSequence struct { Metadata *SubSequenceMetadata SubCommand []exec.Cmd }
A SubSequence is a logical grouping of commands such as a sequence of build, tag, and push commands. In addition, the subsequence metadata contains any important metadata about the container build such as the name of the Dockerfile and which files/dirs to exclude.
type SubSequenceMetadata ¶
type SubSequenceMetadata struct { Name string Dockerfile string Included []string Excluded []string UUID string SkipPush bool }
SubSequenceMetadata contains any important metadata about the container build such as the name of the Dockerfile and which files/dirs to exclude.