Documentation
¶
Index ¶
- func NodeGetArgs(node *parser.Node) []string
- func NodeGetLine(node *parser.Node) string
- func ParseLine(line string) (*parser.Node, error)
- type Dockerfile
- func (d *Dockerfile) AddLineAfterFrom(line string) error
- func (d *Dockerfile) AddNodeAfterFrom(node *parser.Node) error
- func (d *Dockerfile) AppendLine(line string) error
- func (d *Dockerfile) AppendNode(node *parser.Node) error
- func (d *Dockerfile) FilterDisableNetwork() error
- func (d *Dockerfile) FilterOptimize() error
- func (d *Dockerfile) FilterToArm(destArchitecture string) error
- func (d *Dockerfile) From() string
- func (d *Dockerfile) GetNodesByType(nodeType string) []*parser.Node
- func (d *Dockerfile) Length() int
- func (d *Dockerfile) PrependLine(line string) error
- func (d *Dockerfile) PrependNode(node *parser.Node) error
- func (d *Dockerfile) RemoveAt(i int) error
- func (d *Dockerfile) RemoveNodesByType(nodeType string) error
- func (d *Dockerfile) Replace(from, to string) error
- func (d *Dockerfile) SetFrom(from string) error
- func (d *Dockerfile) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NodeGetArgs ¶
NodeGetArgs returns the arguments of a node
func NodeGetLine ¶
NodeGetLine returns the arguments of a node as a string
Types ¶
type Dockerfile ¶
type Dockerfile struct {
// contains filtered or unexported fields
}
func DockerfileFromString ¶
func DockerfileFromString(input string) (*Dockerfile, error)
DockerfileFromString reads a Dockerfiler as string
func DockerfileRead ¶
func DockerfileRead(input io.Reader) (*Dockerfile, error)
DockerfileRead reads a Dockerfile as io.Reader
func (*Dockerfile) AddLineAfterFrom ¶
func (d *Dockerfile) AddLineAfterFrom(line string) error
AddLineAfterFrom parses and add a line after from in the AST
func (*Dockerfile) AddNodeAfterFrom ¶
func (d *Dockerfile) AddNodeAfterFrom(node *parser.Node) error
AddNodeAfterFrom adds a node after from in the AST
func (*Dockerfile) AppendLine ¶
func (d *Dockerfile) AppendLine(line string) error
AppendLine parses and appends a new line to the AST
func (*Dockerfile) AppendNode ¶
func (d *Dockerfile) AppendNode(node *parser.Node) error
AppendNode attach a new node on last position of the AST
func (*Dockerfile) FilterDisableNetwork ¶
func (d *Dockerfile) FilterDisableNetwork() error
func (*Dockerfile) FilterOptimize ¶
func (d *Dockerfile) FilterOptimize() error
func (*Dockerfile) FilterToArm ¶
func (d *Dockerfile) FilterToArm(destArchitecture string) error
func (*Dockerfile) GetNodesByType ¶
func (d *Dockerfile) GetNodesByType(nodeType string) []*parser.Node
GetNodesByType returns nodes matching a type
func (*Dockerfile) PrependLine ¶
func (d *Dockerfile) PrependLine(line string) error
PrependLine parses and prepends a new line to the AST
func (*Dockerfile) PrependNode ¶
func (d *Dockerfile) PrependNode(node *parser.Node) error
PrependNode attach a new node on first position of the AST
func (*Dockerfile) RemoveAt ¶
func (d *Dockerfile) RemoveAt(i int) error
func (*Dockerfile) RemoveNodesByType ¶
func (d *Dockerfile) RemoveNodesByType(nodeType string) error
RemoveNodesByType removes all nodes of a specific type from the AST
func (*Dockerfile) Replace ¶
func (d *Dockerfile) Replace(from, to string) error
Replace tries to replace a string with another in each lines
func (*Dockerfile) SetFrom ¶
func (d *Dockerfile) SetFrom(from string) error
SetFrom sets the current FROM
func (*Dockerfile) String ¶
func (d *Dockerfile) String() string
String returns a docker-readable Dockerfile
