Documentation ¶
Index ¶
Constants ¶
const ( KB = 2 << 9 MB = 2 << 19 GB = 2 << 29 )
Size constants.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Encoder ¶
type Encoder interface { Create(name string) (io.WriteCloser, error) Finalize() error }
type Gen ¶
Gen uses Operate to process files in the FS given as From, and copies its output to To after processing is completed successfully. It only operates on names matched by the Matcher. It uses a temporary buffer for staging before completion.
type GitModule ¶
type GitModule struct { Overwrite bool // Remote specifies the full path to the remote, including e.g. // protocol. Local is the local name that the repo will be // cloned into. Revision (optional) defines a specific revision // to be checked out, such as a tag, commit id, or branch. If // Branch is set, it will be used in git submodule commands. Remote, Local, Branch, Revision string }
GitModule is an optional job which can be added to a Gen pipeline to clone a given Git repository into the local repo.
func (GitModule) Operate ¶
Operate checks for the presence of the Git submodule in the given relative path. If the working directory is not in a Git repo, the GitModule is cloned directly into the target root.
If the working directory is in a Git repo, Operate checks for the GitModule as a submodule of the Git repo, in the given path. If it is not a submodule in the given path, or if g.Overwrite is true, the GitModule is added there as a git submodule using git from the shell.
If it is present, and Overwrite is false, it is ignored.
TODO: Check for a particular revision.
type Target ¶
type Target interface { io.ReaderFrom io.Reader }
Target defines the output formatting of a target language (e.g. C++).
type Work ¶
type Work struct { Jobs <-chan Job Done chan<- Done Kill <-chan struct{} Errs chan<- error // The Encoder is responsible for creating and finalizing the // output files for the specific implementation. Encoder // contains filtered or unexported fields }