models

package
v1.5.3 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2019 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GlobalConfiguration, _ = loadConfiguration()

Functions

func SaveRepoData

func SaveRepoData(key string) error

Types

type Auth

type Auth struct {
	UseSsh bool   `json:"use,omitempty"`
	Path   string `json:"path,omitempty"`
	User   string `json:"x,omitempty"`
	Pass   string `json:"y,omitempty"`
}

func (*Auth) GetPassword

func (a *Auth) GetPassword() string

func (*Auth) GetUser

func (a *Auth) GetUser() string

func (*Auth) SetPass

func (a *Auth) SetPass(pass string)

func (*Auth) SetUser

func (a *Auth) SetUser(user string)

type Configuration

type Configuration struct {
	Key       string           `json:"id"`
	Auth      map[string]*Auth `json:"auth"`
	PurgeTime int              `json:"purgeAfter"`
	LastPurge string           `json:"last_purge"`
}

func (*Configuration) GetAuth

func (c *Configuration) GetAuth(repo string) transport.AuthMethod

func (*Configuration) SaveConfiguration

func (c *Configuration) SaveConfiguration() error

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 (d *Dependency) GetHashName() string

func (*Dependency) GetName

func (d *Dependency) GetName() string

func (*Dependency) GetURL

func (d *Dependency) GetURL() string

func (*Dependency) GetURLPrefix

func (d *Dependency) GetURLPrefix() string

func (*Dependency) GetVersion

func (d *Dependency) GetVersion() string

type Package

type Package struct {
	IsNew           bool        `json:"-"`
	Name            string      `json:"name"`
	Description     string      `json:"description"`
	Version         string      `json:"version"`
	Private         bool        `json:"private"`
	Homepage        string      `json:"homepage"`
	MainSrc         string      `json:"mainsrc"`
	Supported       string      `json:"supported"`
	DprojName       string      `json:"dprojFile"`
	Scripts         interface{} `json:"scripts,omitempty"`
	Dependencies    interface{} `json:"dependencies,omitempty"`
	DevDependencies interface{} `json:"devDependencies,omitempty"`
	// 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) AddDevDependency

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

func (*Package) RemoveDependency

func (p *Package) RemoveDependency(dep string)

func (*Package) Save

func (p *Package) Save()

type RepoInfo

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

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