manifest

package
v0.0.0-...-e600875 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2016 License: Apache-2.0 Imports: 12 Imported by: 11

Documentation

Overview

Package manifest provides methods for the vendor manifest file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manifest

type Manifest struct {
	Vendors []Vendor `json:"vendors" yml:"vendors" toml:"vendors"`
	// contains filtered or unexported fields
}

Manifest describes the manifest file used save repository dependencies and their corresponding revision hashes.

The file is written as JSON, YAML or TOML.

func Load

func Load(format string) (*Manifest, error)

Load reads a vendor manifest file and returns a Manifest object. It also takes an optional format to default the manifest to when written.

func (*Manifest) Append

func (m *Manifest) Append(path, rev string, hold bool)

Append creates a vendor object from a path and revision and appends it to the Manifest.

func (Manifest) Contains

func (m Manifest) Contains(pkg string) (Vendor, bool)

Contains returns true of the package import string is contained in the Manifest object

func (*Manifest) Filename

func (m *Manifest) Filename() string

Filename returns the manifest filename including the format extension.

func (*Manifest) Len

func (m *Manifest) Len() int

Len allows Manifest to satisfy the sort.Interface.

func (*Manifest) Less

func (m *Manifest) Less(i, j int) bool

Less allows Manifest to satisfy the sort.Interface.

func (*Manifest) Remove

func (m *Manifest) Remove(pkg string)

Remove takes a package import string, and removes it from the manifest file.

func (*Manifest) Swap

func (m *Manifest) Swap(i, j int)

Swap allows Manifest to satisfy the sort.Interface.

func (*Manifest) Sync

func (m *Manifest) Sync()

Sync removes orphaned vendored packages from the Manifest.

func (*Manifest) Write

func (m *Manifest) Write() error

Write writes the vendors to the manifest file on disk.

type Vendor

type Vendor struct {
	Path string `json:"path" yaml:"path" toml:"path"`
	Rev  string `json:"rev,omitempty" yaml:"rev,omitempty" toml:"rev,omitempty"`
	Hold bool   `json:"hold,omitempty" yaml:"hold,omitempty" toml:"hold,omitempty"`
}

Vendor describes a repository with its import path and revision hash.

Jump to

Keyboard shortcuts

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