{"modulePath":"github.com/Coding/drone","version":"v0.4.2","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package parse\n\n## Constants\n\n```go\nconst (\n\tNodeBuild     = \"build\"\n\tNodeCache     = \"cache\"\n\tNodeClone     = \"clone\"\n\tNodeContainer = \"container\"\n\tNodeNetwork   = \"network\"\n\tNodePlugin    = \"plugin\"\n\tNodeRoot      = \"root\"\n\tNodeService   = \"service\"\n\tNodeShell     = \"shell\"\n\tNodeVolume    = \"volume\"\n)\n```\n\n## Types\n\n```go\ntype BuildNode struct {\n\tNodeType\n\n\tContext    string\n\tDockerfile string\n\tArgs       map[string]string\n\t// contains filtered or unexported fields\n}\n```\nBuildNode represents Docker image build instructions.\n\n```go\nfunc (n *BuildNode) Root() *RootNode\n```\nRoot returns the root node.\n\n```go\ntype Conditions struct {\n\tPlatform    []string\n\tEnvironment []string\n\tEvent       []string\n\tBranch      []string\n\tStatus      []string\n\tMatrix      map[string]string\n}\n```\n\n```go\ntype ContainerNode struct {\n\tNodeType\n\n\t// Container represents the container configuration.\n\tContainer  runner.Container\n\tConditions Conditions\n\tDisabled   bool\n\tCommands   []string\n\tVargs      map[string]interface{}\n\t// contains filtered or unexported fields\n}\n```\nContainerNode represents a Docker container.\n\n```go\nfunc (n *ContainerNode) OnFailure() bool\n```\nOnFailure returns true if the container should be executed even when the exit code of the previous step != 0.\n\n```go\nfunc (n *ContainerNode) OnSuccess() bool\n```\nOnSuccess returns true if the container should be executed when the exit code of the previous step is 0.\n\n```go\nfunc (n *ContainerNode) Root() *RootNode\n```\nRoot returns the root node.\n\n```go\ntype NetworkNode struct {\n\tNodeType\n\n\tName       string\n\tDriver     string\n\tDriverOpts map[string]string\n\t// contains filtered or unexported fields\n}\n```\nNetworkNode represents a Docker network.\n\n```go\nfunc (n *NetworkNode) Root() *RootNode\n```\nRoot returns the root node.\n\n```go\ntype Node interface {\n\tType() NodeType\n\tRoot() *RootNode\n}\n```\nA Node is an element in the parse tree.\n\n```go\ntype NodeType string\n```\nNodeType identifies the type of parse tree node.\n\n```go\nfunc (t NodeType) String() string\n```\nString returns the string value of the Node type.\n\n```go\nfunc (t NodeType) Type() NodeType\n```\nType returns itself an provides an easy default implementation. for embedding in a Node. Embedded in all non-trivial Nodes.\n\n```go\ntype RootNode struct {\n\tNodeType\n\n\tPlatform string\n\tBase     string\n\tPath     string\n\tImage    string\n\n\tPod      Node\n\tBuild    Node\n\tCache    Node\n\tClone    Node\n\tScript   []Node\n\tVolumes  []Node\n\tNetworks []Node\n\tServices []Node\n}\n```\nRootNode is the root node in the parsed Yaml file.\n\n```go\nfunc NewRootNode() *RootNode\n```\nNewRootNode returns a new root node.\n\n```go\nfunc Parse(in []byte) (*RootNode, error)\n```\nParse parses a Yaml file and returns a Tree structure.\n\n```go\nfunc ParseString(in string) (*RootNode, error)\n```\nParseString parses a Yaml string and returns a Tree structure.\n\n```go\nfunc (n *RootNode) NewBuildNode(context string) *BuildNode\n```\nReturns a new Network Node.\n\n```go\nfunc (n *RootNode) NewCacheNode() *ContainerNode\n```\nReturns a new Container Cache Node.\n\n```go\nfunc (n *RootNode) NewCloneNode() *ContainerNode\n```\nReturns a new Container Clone Node.\n\n```go\nfunc (n *RootNode) NewContainerNode() *ContainerNode\n```\nReturns a new Container Node.\n\n```go\nfunc (n *RootNode) NewNetworkNode(name string) *NetworkNode\n```\nReturns a new Network Node.\n\n```go\nfunc (n *RootNode) NewPluginNode() *ContainerNode\n```\nReturns a new Container Plugin Node.\n\n```go\nfunc (n *RootNode) NewServiceNode() *ContainerNode\n```\nReturns a new Container Service Node.\n\n```go\nfunc (n *RootNode) NewShellNode() *ContainerNode\n```\nReturns a new Container Shell Node.\n\n```go\nfunc (n *RootNode) NewVolumeNode(name string) *VolumeNode\n```\nReturns a new Volume Node.\n\n```go\nfunc (n *RootNode) Root() *RootNode\n```\nRoot returns the root node.\n\n```go\nfunc (n *RootNode) Walk(fn WalkFunc) (err error)\n```\nWalk is a function that walk through all child nodes of the RootNode and invokes the Walk callback function for each Node.\n\n```go\ntype VolumeNode struct {\n\tNodeType\n\n\tName       string\n\tDriver     string\n\tDriverOpts map[string]string\n\tExternal   bool\n\t// contains filtered or unexported fields\n}\n```\nVolumeNode represents a Docker volume.\n\n```go\nfunc (n *VolumeNode) Root() *RootNode\n```\nRoot returns the root node.\n\n```go\ntype WalkFunc func(Node) error\n```\n\n","path":"github.com/Coding/drone/engine/compiler/parse","name":"parse","synopsis":"","isRedistributable":true}
