dependency

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: May 25, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UnknownType = "unknown"
	ManualType  = "manual"
	DockerType  = "docker"
	GithubType  = "github"
)

Variables

This section is empty.

Functions

func DetermineType

func DetermineType(source string) string

DetermineType will try to determine the type for the spec 'unknown' will be returned if it cannot be determined

Types

type ByHash added in v0.4.0

type ByHash []Spec

func (ByHash) Len added in v0.4.0

func (h ByHash) Len() int

func (ByHash) Less added in v0.4.0

func (h ByHash) Less(i, j int) bool

func (ByHash) Swap added in v0.4.0

func (h ByHash) Swap(i, j int)

type FilterOptions

type FilterOptions struct {
	Outdated bool
	Types    []string
}

type Manifest

type Manifest struct {
	APIVersion   string `json:"apiVersion"`
	Dependencies []Spec `json:"dependencies"`
}

Manifest contains a list of dependencies

func FromBytes added in v0.4.0

func FromBytes(in []byte) (*Manifest, error)

func (*Manifest) Append

func (m *Manifest) Append(dep Spec) bool

Append will add a dependency to the struct if it does not already exist Returns false if dependency was not added

func (*Manifest) FromMap added in v0.4.0

func (m *Manifest) FromMap(version string, dependenciesMap map[string]Spec) *Manifest

func (*Manifest) Latest added in v0.4.0

func (m *Manifest) Latest() (*Manifest, error)

func (*Manifest) ToMap added in v0.4.0

func (m *Manifest) ToMap() (string, map[string]Spec, error)

type ManifestWriter

type ManifestWriter struct {
	Writer        io.Writer
	FilterOptions FilterOptions
}

func (ManifestWriter) WriteJSON

func (mf ManifestWriter) WriteJSON(m Manifest) error

func (ManifestWriter) WriteTable

func (mf ManifestWriter) WriteTable(m Manifest)

func (ManifestWriter) WriteYAML

func (mf ManifestWriter) WriteYAML(m Manifest) error

type Spec

type Spec struct {
	Name          string `yaml:"name" json:"name"`
	Type          string `yaml:"type" json:"type"`
	Version       string `yaml:"version" json:"version"`
	LatestVersion string `yaml:"latestVersion,omitempty" json:"latestVersion"`
	Mask          string `yaml:"mask,omitempty" json:"mask"`
	Notes         string `yaml:"notes,omitempty" json:"notes"`
}

Spec describes a resource Type: github, docker, manual Source will be specific to a 'Type'

func (Spec) GetType

func (s Spec) GetType() string

func (Spec) Hash added in v0.4.0

func (s Spec) Hash() (string, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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