mobyparser

package
v0.82.3 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultForm

func DefaultForm(node *parser.Node) (arguments string)

DefaultForm format is the default instruction line

func ExecForm

func ExecForm(node *parser.Node) (arguments string)

ExecForm format instruction arguments to an exec form, like ["/bin/bash"]

func KeyValueForm

func KeyValueForm(node *parser.Node, tab string) (arguments string)

KeyValueForm format instruction arguments and add '=' between a key and a value, like `LABEL key=value`

func Marshal

func Marshal(data *parser.Result, document *string) (err error)

Marshal takes a dockerfile node as parameter, parse its AST graph then return line by line as a string Remark: Dockerfile Comments are not yet supported and therefor deleted in the process

func ShellForm

func ShellForm(node *parser.Node) (arguments string)

ShellForm format a line instruction containing shell commands, like RUN "echo true && echo false"

Types

type MobyParser

type MobyParser struct {
	// Specifies the Dockerfile instruction such as ENV
	Instruction string `yaml:",omitempty"`
	// Specifies the Dockerfile value for the instruction
	Value string `yaml:",omitempty"`
}

func (MobyParser) FindInstruction

func (m MobyParser) FindInstruction(dockerfileContent []byte) bool

func (MobyParser) ReplaceInstructions

func (m MobyParser) ReplaceInstructions(dockerfileContent []byte, sourceValue string) ([]byte, types.ChangedLines, error)

func (MobyParser) String

func (m MobyParser) String() string

Jump to

Keyboard shortcuts

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