Documentation ¶
Overview ¶
Package cfg handles working with the Glide configuration files.
Index ¶
- type Config
- func (c *Config) Clone() *Config
- func (c *Config) DeDupe() error
- func (c *Config) HasDependency(name string) bool
- func (c *Config) HasIgnore(name string) bool
- func (c *Config) Hash() (string, error)
- func (c *Config) Marshal() ([]byte, error)
- func (c *Config) MarshalYAML() (interface{}, error)
- func (c *Config) UnmarshalYAML(unmarshal func(interface{}) error) error
- type Dependencies
- type Dependency
- type Lock
- type Lockfile
- type Locks
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Name string `yaml:"package"` Ignore []string `yaml:"ignore,omitempty"` Imports Dependencies `yaml:"import"` DevImports Dependencies `yaml:"devimport,omitempty"` }
Config is the top-level configuration object.
func ConfigFromYaml ¶
ConfigFromYaml returns an instance of Config from YAML
func (*Config) HasDependency ¶
HasDependency returns true if the given name is listed as an import or dev import.
func (*Config) MarshalYAML ¶
MarshalYAML is a hook for gopkg.in/yaml.v2 in the marshaling process
func (*Config) UnmarshalYAML ¶
UnmarshalYAML is a hook for gopkg.in/yaml.v2 in the unmarshalling process
type Dependencies ¶
type Dependencies []*Dependency
Dependencies is a collection of Dependency
func (Dependencies) Clone ¶
func (d Dependencies) Clone() Dependencies
Clone performs a deep clone of Dependencies
func (Dependencies) DeDupe ¶
func (d Dependencies) DeDupe() (Dependencies, error)
DeDupe cleans up duplicates on a list of dependencies.
func (Dependencies) Get ¶
func (d Dependencies) Get(name string) *Dependency
Get a dependency by name
type Dependency ¶
type Dependency struct { Name string `yaml:"package"` Reference string `yaml:"version,omitempty"` Pin string `yaml:"-"` Repository string `yaml:"repo,omitempty"` VcsType string `yaml:"vcs,omitempty"` Subpackages []string `yaml:"subpackages,omitempty"` Arch []string `yaml:"arch,omitempty"` Os []string `yaml:"os,omitempty"` UpdateAsVendored bool `yaml:"-"` }
Dependency describes a package that the present package depends upon.
func (*Dependency) Clone ¶
func (d *Dependency) Clone() *Dependency
Clone creates a clone of a Dependency
func (*Dependency) GetRepo ¶
func (d *Dependency) GetRepo(dest string) (vcs.Repo, error)
GetRepo retrieves a Masterminds/vcs repo object configured for the root of the package being retrieved.
func (*Dependency) MarshalYAML ¶
func (d *Dependency) MarshalYAML() (interface{}, error)
MarshalYAML is a hook for gopkg.in/yaml.v2 in the marshaling process
func (*Dependency) UnmarshalYAML ¶
func (d *Dependency) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML is a hook for gopkg.in/yaml.v2 in the unmarshaling process
type Lockfile ¶
type Lockfile struct { Hash string `yaml:"hash"` Updated time.Time `yaml:"updated"` Imports Locks `yaml:"imports"` DevImports Locks `yaml:"devImports"` }
Lockfile represents a glide.lock file.
func LockfileFromMap ¶
func LockfileFromMap(ds map[string]*Dependency, hash string) *Lockfile
func LockfileFromYaml ¶
LockfileFromYaml returns an instance of Lockfile from YAML
func NewLockfile ¶
func NewLockfile(ds Dependencies, hash string) *Lockfile