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 AddOptions
- type Commit
- type Manager
- func (m *Manager) Add(repo string, dest string, options AddOptions, sources ...string) error
- func (m *Manager) AddByNamedRef(repoRef reference.Named, dest string, options AddOptions, sources ...string) error
- 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) Fetch(refStr string) error
- func (m *Manager) FetchByNamedRef(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")
)
var (
ErrRepositoryCorruptedNoName = errors.New("corrupted repository, no valid name")
)
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 AddOptions ¶ added in v0.0.3
type AddOptions struct { //Chmod sets the access permissions of the destination content. Chmod string // Chown is a spec for the user who should be given ownership over the // newly-added content, potentially overriding permissions which would // otherwise be set to 0:0. Chown string Message string ReportWriter io.Writer }
AddOptions holds option to Repository.Add method.
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) AddByNamedRef ¶ added in v0.0.3
func (m *Manager) AddByNamedRef(repoRef reference.Named, dest string, options AddOptions, sources ...string) error
Add commit the given files.
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) FetchByNamedRef ¶ added in v0.0.2
FetchByNamedRef updates every repository reference.
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) Mount ¶ added in v0.0.2
func (r *Repository) Mount() (string, error)
Mount mounts the repository and returns the mountpoint.
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.
func (*Repository) Unmount ¶ added in v0.0.2
func (r *Repository) Unmount() error
Unmount unmount the repository.