repository

package
v0.0.0-...-ea498fe Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2017 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidType is returned when repository type is invalid
	ErrInvalidType = errors.New("Invalid repository type")

	// ErrDuplicate is returned when adding duplicate repository
	ErrDuplicate = errors.New("Duplicate repository")

	// ErrNotFound is returned when queried repository does not exist
	ErrNotFound = errors.New("Repository not found")
)

Functions

func ID

func ID(t Type, URL string) string

ID returns an ID for a repository

Types

type Container

type Container interface {
	Repositories() []string
	Repository(t Type, URL string) (Repository, error)
	Ensure(t Type, URL string) (Repository, error)
	Remove(t Type, URL string) error
}

Container is the repositories manager

func NewContainer

func NewContainer() Container

NewContainer creates a new repository manager

type Repository

type Repository interface {
	ID() string
	Type() Type
	URL() string
	File(filename string) ([]byte, error)
	Clone(dst string) error
	Update() error
	Init() error
	Cleanup() error
}

Repository represents a VCS repository

func New

func New(t Type, URL string) (Repository, error)

New creates a new Repository

type Type

type Type string

Type identifies a repository type

func (Type) Validate

func (t Type) Validate() error

Validate validates a repository type

Jump to

Keyboard shortcuts

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