repository

package
v0.0.0-...-6f97703 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2020 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Dir     = ".tape"
	Version = "1.0"
	Config  = "config"
)

Variables

View Source
var (
	ErrMissingParameter        = errors.New("missing parameter")
	ErrTapeAlreadyInitialized  = errors.New("tape is already initialized")
	ErrTapeNotInitialized      = errors.New("tape is not initialized")
	ErrDependencyAlreadyExists = errors.New("dependency already exists try update instead")
	ErrDependencyNotFound      = errors.New("dependency not found add instead")
	ErrFileMismatch            = errors.New("file mismatch")
)

Functions

func AddAuthFromNetrc

func AddAuthFromNetrc(rawurl string, req *http.Request) *http.Request

addAuthFromNetrc uses basic authentication on go-get requests for private repositories.

func Create

func Create(repositoryURL string) error

func FileHash

func FileHash(path string) (string, error)

func HTTPDownload

func HTTPDownload(url, path string) error

func LinksDir

func LinksDir() string

func TapeHome

func TapeHome() string

Types

type Dependencies

type Dependencies []Dependency

type Dependency

type Dependency struct {
	Name    string `json:"name"`
	URL     string `json:"url"`
	Hash    string `json:"hash"`
	Type    Type   `json:"type"`
	Version string `json:"version,omitempty"`
}
func (d *Dependency) Link() error
func (d *Dependency) Unlink() error

type Repository

type Repository struct {
	Version      string       `json:"version"`
	URL          string       `json:"url"`
	Dependencies Dependencies `json:"dependencies,omitempty"`
}

func Load

func Load() (*Repository, error)

func (*Repository) Add

func (r *Repository) Add(name, url string) error
func (r *Repository) Link() error

func (*Repository) Remove

func (r *Repository) Remove(name string) error

func (*Repository) Save

func (r *Repository) Save() error

func (*Repository) Update

func (r *Repository) Update(name, url string) error

type Type

type Type int
const (
	Executable Type = iota + 0
	Directory
)

func DeterminateType

func DeterminateType(path string) Type

hacky hacky we expect archives to be directories...

Jump to

Keyboard shortcuts

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