models

package
v3.0.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2019 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDependenciesNames

func GetDependenciesNames(deps []Dependency) []string

func SaveRepoData

func SaveRepoData(key string, versions []string)

Types

type Dependency

type Dependency struct {
	Repository string

	UseSSH bool
	// contains filtered or unexported fields
}

func GetDependencies

func GetDependencies(deps map[string]interface{}) []Dependency

func ParseDependency

func ParseDependency(repo string, info string) Dependency

func (*Dependency) GetHashName

func (p *Dependency) GetHashName() string

func (*Dependency) GetName

func (p *Dependency) GetName() string

func (*Dependency) GetURL

func (p *Dependency) GetURL() string

func (*Dependency) GetURLPrefix

func (p *Dependency) GetURLPrefix() string

func (*Dependency) GetVersion

func (p *Dependency) GetVersion() string

type DependencyArtifacts

type DependencyArtifacts struct {
	Bin []string `json:"bin,omitempty"`
	Dcp []string `json:"dcp,omitempty"`
	Dcu []string `json:"dcu,omitempty"`
	Bpl []string `json:"bpl,omitempty"`
}

func (*DependencyArtifacts) Clean

func (p *DependencyArtifacts) Clean()

type LockedDependency

type LockedDependency struct {
	Name      string              `json:"name"`
	Version   string              `json:"version"`
	Hash      string              `json:"hash"`
	Artifacts DependencyArtifacts `json:"artifacts"`
	Failed    bool                `json:"failed"`
	Changed   bool                `json:"changed"`
}

func (LockedDependency) GetArtifacts

func (p LockedDependency) GetArtifacts() []string

type Package

type Package struct {
	IsNew        bool        `json:"-"`
	Name         string      `json:"name"`
	Description  string      `json:"description"`
	Version      string      `json:"version"`
	Homepage     string      `json:"homepage"`
	MainSrc      string      `json:"mainsrc"`
	Projects     []string    `json:"projects"`
	Scripts      interface{} `json:"scripts,omitempty"`
	Dependencies interface{} `json:"dependencies"`
	Lock         PackageLock `json:"-"`
	// contains filtered or unexported fields
}

func LoadPackage

func LoadPackage(createNew bool) (*Package, error)

func LoadPackageOther

func LoadPackageOther(path string) (*Package, error)

func (*Package) AddDependency

func (p *Package) AddDependency(dep string, ver string)

func (*Package) AddProject

func (p *Package) AddProject(project string)

func (*Package) GetParsedDependencies

func (p *Package) GetParsedDependencies() []Dependency

func (*Package) Save

func (p *Package) Save()

func (*Package) UninstallDependency

func (p *Package) UninstallDependency(dep string)

type PackageLock

type PackageLock struct {
	Hash      string                      `json:"hash"`
	Updated   time.Time                   `json:"updated"`
	Installed map[string]LockedDependency `json:"installedModules"`
	// contains filtered or unexported fields
}

func LoadPackageLock

func LoadPackageLock(parentPackage *Package) PackageLock

func (PackageLock) AddInstalled

func (p PackageLock) AddInstalled(dep Dependency, version string)

func (PackageLock) CleanRemoved

func (p PackageLock) CleanRemoved(deps []Dependency)

func (PackageLock) GetArtifactList

func (p PackageLock) GetArtifactList() []string

func (PackageLock) GetInstalled

func (p PackageLock) GetInstalled(dep Dependency) LockedDependency

func (PackageLock) NeedUpdate

func (p PackageLock) NeedUpdate(dep Dependency, version string) bool

func (PackageLock) Save

func (p PackageLock) Save()

func (PackageLock) SetInstalled

func (p PackageLock) SetInstalled(dep Dependency, locked LockedDependency)

type RepoInfo

type RepoInfo struct {
	Key        string    `json:"key"`
	LastUpdate time.Time `json:"last_update"`
	Versions   []string  `json:"versions"`
}

func RepoData

func RepoData(key string) (*RepoInfo, error)

RepoData retrieves cached information about a repo.

Jump to

Keyboard shortcuts

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