pkg

package
v0.0.0-...-69c0340 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Install

func Install(file DependencyFile, skipDev bool, quiet bool) error

@todo convert the third param to options

Types

type Autoload

type Autoload struct {
	Classmap            []string `json:"classmap,omitempty"`
	ExcludeFromClassmap []string `json:"exclude-from-classmap,omitempty"`
	Files               []string `json:"files,omitempty"`
	PSR0                FlexPSR  `json:"psr-0,omitempty"`
	PSR4                FlexPSR  `json:"psr-4,omitempty"`
}

@doc https://engineering.bitnami.com/articles/dealing-with-json-with-non-homogeneous-types-in-go.html

func (*Autoload) MarshalJSON

func (autoload *Autoload) MarshalJSON() ([]byte, error)

type DependencyFile

type DependencyFile interface {
	Filename() string
	Fullpath() string
	Dirpath() string
	Dependencies(withDev bool) []Package
}

DependencyFile represents all of the behavior required to manage project dependency files.

func LoadFile

func LoadFile(path string) (DependencyFile, error)

LoadFile will generate a DependencyFile from a given path.

type Distribution

type Distribution struct {
	Type      string `json:"type"`
	URL       string `json:"url"`
	Reference string `json:"reference"`
	Shasum    string `json:"shasum"`
}

type FlexPSR

type FlexPSR struct {
	Single   *map[string]string   `json:",omitempty"`
	Multiple *map[string][]string `json:",omitempty"`
}

func (*FlexPSR) UnmarshalJSON

func (fpsr *FlexPSR) UnmarshalJSON(b []byte) error

type Lockfile

type Lockfile struct {
	Location string            `json:"location"`
	Contents *LockfileContents `json:"contents"`
}

func LoadLockfile

func LoadLockfile(path string) (*Lockfile, error)

LoadLockfile will find and parse a .lock file from the given path.

type LockfileContents

type LockfileContents struct {
	Readme      []string  `json:"_readme,omitempty"`
	Packages    []Package `json:"packages"`
	PackagesDev []Package `json:"packages-dev"`
}

type Package

type Package struct {
	Name         string       `json:"name"`
	Version      string       `json:"version"`
	Distribution Distribution `json:"dist"`
	Description  string       `json:"description"`
	Autoload     Autoload     `json:"autoload"`
}

Jump to

Keyboard shortcuts

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