Documentation ¶
Index ¶
- Constants
- Variables
- func ParseRemoteRepoReference(ref string) (reference.Named, error)
- func ParseRepoName(repoName string) (reference.Named, error)
- func ParseRepoReference(ref string) (reference.Named, error)
- type Commit
- type Manager
- func (m *Manager) Checkout(refStr string) error
- func (m *Manager) CheckoutByRef(ref reference.Named) error
- func (m *Manager) Clone(name string) error
- func (m *Manager) CloneByNamedRef(named reference.Named) error
- func (m *Manager) Repositories() ([]*Repository, error)
- func (m *Manager) Repository(name string) (*Repository, error)
- func (m *Manager) RepositoryByNamedRef(named reference.Named) (*Repository, error)
- type Repository
Constants ¶
const (
HeadTag = "HEAD"
)
Variables ¶
var ( ErrRepoNameContainsTagOrDigest = errors.New("repository name can't contain any tag or digest") ErrRepoReferenceIsNotNamed = errors.New("repository reference is not a named reference") ErrRemoteRepoReferenceContainsHeadTag = errors.New("remote repository reference contains a HEAD tag") )
var (
ErrLocalRepositoryAlreadyExist = errors.New("local repository with the same name already exist")
)
Functions ¶
func ParseRemoteRepoReference ¶
ParseRemoteRepoReference parses the given remote repository reference and returns it if valid. A remote repository reference is invalid if it contains a HEAD tag.
func ParseRepoName ¶
ParseRepoName parses the given repository name and returns if it is a valid name. An error is returned if the reference is tagged.
Types ¶
type Commit ¶
type Commit struct {
// contains filtered or unexported fields
}
Commit define the history of a single layer.
func (*Commit) CreationDate ¶
CreationDate returns the creation date of the commit.
func (*Commit) Empty ¶
Empty returns true if this commit doesn't correspond to an actual layer in rootfs.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager defines a repositories manager.
func NewManagerFromStore ¶
NewManagerFromStore returns a new Manager using the given store. An error is returned if libimage.Runtime can't be created using the given store and system context. Call Destroy() once you're done with the manager.
func (*Manager) CheckoutByRef ¶
CheckoutByRef moves repository's HEAD associated to the given reference to another reference. Name of the repository is extracted from the given reference.
func (*Manager) CloneByNamedRef ¶
CloneByNamedRef clones remote repository with the given remote repository reference to local storage.
func (*Manager) Repositories ¶
func (m *Manager) Repositories() ([]*Repository, error)
Repositories returns the list of repositories
func (*Manager) Repository ¶
func (m *Manager) Repository(name string) (*Repository, error)
Repository returns the repository associated with the given name.
func (*Manager) RepositoryByNamedRef ¶
func (m *Manager) RepositoryByNamedRef(named reference.Named) (*Repository, error)
RepositoryByNamedRef returns the repository associated with the given reference name.
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
func (*Repository) Commits ¶
func (r *Repository) Commits() ([]Commit, error)
Commits returns the commits history of this repository.
func (*Repository) Name ¶
func (r *Repository) Name() (string, error)
Name returns the name of the repository.
func (*Repository) Tags ¶
func (r *Repository) Tags() ([]string, error)
Tags returns other tags pointing to the same commit as HEAD.