Documentation ¶
Index ¶
- Constants
- Variables
- func About(c cookoo.Context, p *cookoo.Params) (interface{}, cookoo.Interrupt)
- func AddDependencies(c cookoo.Context, p *cookoo.Params) (interface{}, cookoo.Interrupt)
- func AlreadyGliding(c cookoo.Context, p *cookoo.Params) (interface{}, cookoo.Interrupt)
- func BeQuiet(c cookoo.Context, p *cookoo.Params) (interface{}, cookoo.Interrupt)
- func Color(code, msg string) string
- func CowardMode(c cookoo.Context, p *cookoo.Params) (interface{}, cookoo.Interrupt)
- func Debug(msg string, args ...interface{})
- func DropToShell(c cookoo.Context, p *cookoo.Params) (interface{}, cookoo.Interrupt)
- func ErrMsg(msg string, args ...interface{})
- func Error(msg string, args ...interface{})
- func ExecCmd(c cookoo.Context, p *cookoo.Params) (interface{}, cookoo.Interrupt)
- func GetImports(c cookoo.Context, p *cookoo.Params) (interface{}, cookoo.Interrupt)
- func GlideGopath(filename string) (string, error)
- func Godeps(c cookoo.Context, p *cookoo.Params) (interface{}, cookoo.Interrupt)
- func GodepsGit(c cookoo.Context, p *cookoo.Params) (interface{}, cookoo.Interrupt)
- func GuessDeps(c cookoo.Context, p *cookoo.Params) (interface{}, cookoo.Interrupt)
- func GuessVCS(dep *Dependency) (uint, error)
- func HasGodeps(c cookoo.Context, p *cookoo.Params) (interface{}, cookoo.Interrupt)
- func In(c cookoo.Context, p *cookoo.Params) (interface{}, cookoo.Interrupt)
- func InGopath(c cookoo.Context, p *cookoo.Params) (interface{}, cookoo.Interrupt)
- func Info(msg string, args ...interface{})
- func InitGlide(c cookoo.Context, p *cookoo.Params) (interface{}, cookoo.Interrupt)
- func Into(c cookoo.Context, p *cookoo.Params) (interface{}, cookoo.Interrupt)
- func LinkPackage(c cookoo.Context, p *cookoo.Params) (interface{}, cookoo.Interrupt)
- func MergeToYaml(c cookoo.Context, p *cookoo.Params) (interface{}, cookoo.Interrupt)
- func Mkdir(c cookoo.Context, p *cookoo.Params) (interface{}, cookoo.Interrupt)
- func Msg(msg string, args ...interface{})
- func ParseYaml(c cookoo.Context, p *cookoo.Params) (interface{}, cookoo.Interrupt)
- func ParseYamlString(c cookoo.Context, p *cookoo.Params) (interface{}, cookoo.Interrupt)
- func ReadyToGlide(c cookoo.Context, p *cookoo.Params) (interface{}, cookoo.Interrupt)
- func Rebuild(c cookoo.Context, p *cookoo.Params) (interface{}, cookoo.Interrupt)
- func SetReference(c cookoo.Context, p *cookoo.Params) (interface{}, cookoo.Interrupt)
- func Status(c cookoo.Context, p *cookoo.Params) (interface{}, cookoo.Interrupt)
- func UpdateImports(c cookoo.Context, p *cookoo.Params) (interface{}, cookoo.Interrupt)
- func UpdateReferences(c cookoo.Context, p *cookoo.Params) (interface{}, cookoo.Interrupt)
- func VcsGet(dep *Dependency) error
- func VcsLastCommit(dep *Dependency) (string, error)
- func VcsSetReference(dep *Dependency) error
- func VcsUpdate(dep *Dependency) error
- func VcsVersion(dep *Dependency) error
- func Warn(msg string, args ...interface{})
- func WriteYaml(c cookoo.Context, p *cookoo.Params) (interface{}, cookoo.Interrupt)
- type BzrVCS
- type Config
- type Dependency
- type GitVCS
- type GoGetVCS
- type HgVCS
- type SvnVCS
- type VCS
Constants ¶
const ( NoVCS uint = iota Git Bzr Hg Svn )
const ( Blue = "0;34" Red = "0;31" Green = "0;32" Yellow = "0;33" Cyan = "0;36" Pink = "1;35" )
These contanstants map to color codes for shell scripts making them human readable.
Variables ¶
var Quiet = false
Quiet, when set to true, can suppress Info and Debug messages.
Functions ¶
func AddDependencies ¶
AddDependencies adds a list of *Dependency objects to the given *Config.
This is used to merge in packages from other sources or config files.
func AlreadyGliding ¶
AlreadyGliding emits a warning (and stops) if we're in a glide session.
This should be used when you want to make sure that we're not already in a glide environment.
func Color ¶
Color returns a string in a certain color. The first argument is a string containing the color code or a constant from the table above mapped to a code.
The following will print the string "Foo" in yellow:
fmt.Print(Color(Yellow, "Foo"))
func CowardMode ¶
func DropToShell ¶
func GetImports ¶
func GlideGopath ¶
GlideGopath returns the GOPATH for a Glide project.
It determines the GOPATH by searching for the glide.yaml file, and then assuming the _vendor/ directory is in that directory. It traverses the tree upwards (e.g. only ancestors).
If no glide.yaml is found, or if a directory cannot be read, this returns an error.
func Godeps ¶
Godeps parses a Godeps file.
Params
- dir (string): Directory root.
Returns an []*Dependency
func GuessDeps ¶
GuessDeps tries to get the dependencies for the current directory.
Params
- dirname (string): Directory to use as the base. Default: "."
func GuessVCS ¶
func GuessVCS(dep *Dependency) (uint, error)
func InitGlide ¶
InitGlide initializes a new Glide project.
Among other things, it creates a default glide.yaml.
func Into ¶
Into starts a new shell as a child of glide. This new shell inherits the environment typical of a Glide In, but without any shell export weirdness. Optionally, if a path is provided, this will glide into *that* directory.
PARAMS
- into (string): The directory to glide into.
func LinkPackage ¶
func MergeToYaml ¶
Convert a Config object and a yaml.File to a single yaml.File.
Params:
- conf (*Config): The configuration to merge.
- overwriteImports (bool, default true): If this is true, old config will overwritten. If false, we attempt to merge the old and new config, with preference to the old.
Returns:
- The root yaml.Node of the modified config.
Uses:
- cxt.Get("yaml.File") as the source for the YAML file.
func Msg ¶
func Msg(msg string, args ...interface{})
Msg prints a message with optional arguments, that can be printed, of varying types.
func ParseYaml ¶
ParseYaml parses the glide.yaml format and returns a Configuration object.
Params:
- filename (string): YAML filename as a string
Context:
- yaml.File: This puts the parsed YAML file into the context.
Returns:
- *Config: The configuration.
func ParseYamlString ¶
func ReadyToGlide ¶
ReadyToGlide fails if the environment is not sufficient for using glide.
Most importantly, it fails if glide.yaml is not present in the current working directory.
func SetReference ¶
func UpdateImports ¶
func UpdateReferences ¶
UpdateRevisions updates the revision numbers on all of the imports.
func VcsGet ¶
func VcsGet(dep *Dependency) error
VcsGet figures out how to fetch a dependency, and then gets it.
Usually it delegates to lower-level *Get functions.
See https://code.google.com/p/go/source/browse/src/cmd/go/vcs.go
func VcsLastCommit ¶
func VcsLastCommit(dep *Dependency) (string, error)
func VcsSetReference ¶
func VcsSetReference(dep *Dependency) error
func VcsUpdate ¶
func VcsUpdate(dep *Dependency) error
VcsUpdate updates to a particular checkout based on the VCS setting.
func VcsVersion ¶
func VcsVersion(dep *Dependency) error
Types ¶
type BzrVCS ¶
type BzrVCS struct{}
func (*BzrVCS) Get ¶
func (b *BzrVCS) Get(dep *Dependency) error
func (*BzrVCS) LastCommit ¶
func (b *BzrVCS) LastCommit(dep *Dependency) (string, error)
func (*BzrVCS) Update ¶
func (b *BzrVCS) Update(dep *Dependency) error
func (*BzrVCS) Version ¶
func (b *BzrVCS) Version(dep *Dependency) error
type Config ¶
type Config struct { Name string Imports []*Dependency DevImports []*Dependency // InCommand is the default shell command run to start a 'glide in' // session. InCommand string }
Config is the top-level configuration object.
type Dependency ¶
Dependency describes a package that the present package depends upon.
func DependencyFromYaml ¶
func DependencyFromYaml(node yaml.Node) (*Dependency, error)
DependencyFromYaml creates a dependency from a yaml.Node.
func (*Dependency) ToYaml ¶
func (d *Dependency) ToYaml() yaml.Node
ToYaml converts a *Dependency to a YAML Map node.
type GitVCS ¶
type GitVCS struct{}
func (*GitVCS) Get ¶
func (g *GitVCS) Get(dep *Dependency) error
GitGet implements the getting logic for Git.
func (*GitVCS) LastCommit ¶
func (g *GitVCS) LastCommit(dep *Dependency) (string, error)
func (*GitVCS) Update ¶
func (g *GitVCS) Update(dep *Dependency) error
func (*GitVCS) Version ¶
func (g *GitVCS) Version(dep *Dependency) error
type GoGetVCS ¶
type GoGetVCS struct{}
GoGetVCS implements a VCS for 'go get'.
func (*GoGetVCS) Get ¶
func (g *GoGetVCS) Get(dep *Dependency) error
func (*GoGetVCS) LastCommit ¶
func (g *GoGetVCS) LastCommit(dep *Dependency) (string, error)
LastCommit always retuns "" for GoGet, which is not revision-aware.
func (*GoGetVCS) Update ¶
func (g *GoGetVCS) Update(dep *Dependency) error
func (*GoGetVCS) Version ¶
func (g *GoGetVCS) Version(dep *Dependency) error
type HgVCS ¶
type HgVCS struct{}
func (*HgVCS) Get ¶
func (h *HgVCS) Get(dep *Dependency) error
hgGet implements the getting logic for hg.
func (*HgVCS) LastCommit ¶
func (h *HgVCS) LastCommit(dep *Dependency) (string, error)
func (*HgVCS) Update ¶
func (h *HgVCS) Update(dep *Dependency) error
func (*HgVCS) Version ¶
func (h *HgVCS) Version(dep *Dependency) error
type SvnVCS ¶
type SvnVCS struct{}
func (*SvnVCS) Get ¶
func (s *SvnVCS) Get(dep *Dependency) error
svnGet implements the getting logic for svn.
func (*SvnVCS) LastCommit ¶
func (s *SvnVCS) LastCommit(dep *Dependency) (string, error)
func (*SvnVCS) Update ¶
func (s *SvnVCS) Update(dep *Dependency) error
func (*SvnVCS) Version ¶
func (s *SvnVCS) Version(dep *Dependency) error
type VCS ¶
type VCS interface { Get(*Dependency) error Update(*Dependency) error Version(*Dependency) error LastCommit(*Dependency) (string, error) }