env

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2014 License: Apache-2.0 Imports: 9 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PROJFILE = ".go.yaml"

Functions

func FindProjRoot

func FindProjRoot(dir string) (string, error)

FindProjRoot returns the directory name of the parent that contains the .go.yaml file

func IsProjRoot

func IsProjRoot(dir string) bool

IsProjRoot returns whether or not a particular directory is the project root for a goat project (aka, whether or not it has a goat file)

Types

type GoatEnv

type GoatEnv struct {
	// ProjRoot is the absolute path to the project root in the current
	// environment
	ProjRoot string

	// Path is the path that the project will be using for its own internal
	// import statements, and consequently what other projects depending on this
	// one will use as well.
	Path string `yaml:"path"`

	// Dependencies are the dependencies listed in the project's project file
	Dependencies []Dependency `yaml:"deps"`
}

func NewGoatEnv

func NewGoatEnv(projroot string) (*GoatEnv, error)

NewGoatEnv takes in the directory where a goat project file can be found, creates the GoatEnv struct based on that file, and returns it

func (*GoatEnv) AbsDepDir

func (genv *GoatEnv) AbsDepDir() string

AbsDepDir is the absolute path to the dependency directory inside the goat data directory

func (*GoatEnv) AbsGoatDir

func (genv *GoatEnv) AbsGoatDir() string

AbsGoatDir is the absolute path to the goat data directory

func (*GoatEnv) AbsProjFile

func (genv *GoatEnv) AbsProjFile() string

AbsProjFile is the absolute path to the goat project file for this environment

func (*GoatEnv) FetchDependencies

func (genv *GoatEnv) FetchDependencies(depdir string) error

FetchDependencies goes and retrieves the dependencies for the GoatEnv. If the dependencies have any goat project files in them, this will fetch the dependencies listed therein as well. All dependencies are placed in the root project's lib directory, INCLUDING any sub-dependencies. This is done on purpose!

func (*GoatEnv) PrependToGoPath

func (genv *GoatEnv) PrependToGoPath() error

func (*GoatEnv) Setup

func (genv *GoatEnv) Setup() error

Setup makes sure the goat env has all the proper directories created inside of it. This includes the lib/ directory, and if it's specified the Path loopback in the lib/ directory

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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