yaml

package
v0.0.0-...-8802d38 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2015 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package yaml provides the ability to work with glide.yaml files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToYaml

func ToYaml(cfg *Config) (string, error)

ToYaml takes a *Config instance and converts it into a yaml string.

Types

type Config

type Config struct {
	Parent     *Config      `yaml:"-"`
	Name       string       `yaml:"package"`
	Imports    Dependencies `yaml:"import"`
	DevImports Dependencies `yaml:"devimport,omitempty"`
}

Config is the top-level configuration object.

func FromYaml

func FromYaml(yml string) (*Config, error)

FromYaml takes a yaml string and converts it to a Config instance.

func (*Config) Clone

func (c *Config) Clone() *Config

Clone performs a deep clone of the Config instance

func (*Config) DeDupe

func (c *Config) DeDupe() error

func (*Config) GetRoot

func (c *Config) GetRoot() *Config

GetRoot follows the Parent down to the top node

func (*Config) HasDependency

func (c *Config) HasDependency(name string) bool

HasDependency returns true if the given name is listed as an import or dev import.

func (*Config) HasRecursiveDependency

func (c *Config) HasRecursiveDependency(name string) bool

HasRecursiveDependency returns true if this config or one of it's parents has this dependency

type Dependencies

type Dependencies []*Dependency

Dependencies is a collection of Dependency

func (Dependencies) Clone

func (d Dependencies) Clone() 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"`
	Ref              string   `yaml:"ref,omitempty"`
	Pin              string   `yaml:"pin,omitempty"`
	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

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.

Jump to

Keyboard shortcuts

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