Documentation
¶
Index ¶
- Variables
- type AddOptions
- type CloneOptions
- type Commit
- type CommitOptions
- type ExecOptions
- type FetchOptions
- type Manager
- func (m *Manager) Clone(remoteRef reference.RemoteRepository, options CloneOptions) error
- func (m *Manager) Fetch(remoteRef reference.RemoteRepository, options FetchOptions) error
- func (m *Manager) LocalRepositoryExist(name reference.Named) bool
- func (m *Manager) Repositories() ([]*Repository, error)
- func (m *Manager) Repository(name reference.Named) (*Repository, error)
- type PullOptions
- type Repository
- func (r *Repository) Add(dest string, options AddOptions, sources ...string) error
- func (r *Repository) AddTag(tag reference.Tagged) error
- func (r *Repository) Checkout(tag reference.Tagged) error
- func (r *Repository) Commits() ([]Commit, error)
- func (r *Repository) Exec(options ExecOptions, cmd string, args ...string) error
- func (r *Repository) HeadRef() reference.LocalRepository
- func (r *Repository) HeadTags() []string
- func (r *Repository) ID() string
- func (r *Repository) Mount() (string, error)
- func (r *Repository) Name() string
- func (r *Repository) OtherTags() ([]string, error)
- func (r *Repository) ReloadHead() error
- func (r *Repository) RemoveTag(tag reference.Tagged) error
- func (r *Repository) Unmount() error
Constants ¶
This section is empty.
Variables ¶
var ( ErrLocalRepositoryAlreadyExist = errors.New("local repository with the same name already exist") ErrLocalRepositoryUnknown = errors.New("unknown local repository") )
var (
ErrRepositoryInvalidNoName = errors.New("invalid repository, no valid name")
)
Functions ¶
This section is empty.
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 Manager.Add method.
type CloneOptions ¶ added in v0.0.4
type CloneOptions struct {
PullOptions
}
CloneOptions holds clone options.
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.
type CommitOptions ¶ added in v0.0.4
CommitOptions contains options to add a commit to repository.
type ExecOptions ¶ added in v0.0.4
type ExecOptions struct {
Stdin io.Reader
Stdout io.Writer
Stderr io.Writer
Message string
ReportWriter io.Writer
}
ExecOptions holds options for Manager.Exec method.
type FetchOptions ¶ added in v0.0.4
type FetchOptions struct {
PullOptions
}
FetchOptions holds fetch options.
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) Clone ¶
func (m *Manager) Clone(remoteRef reference.RemoteRepository, options CloneOptions) error
Clone clones remote repository with the given name to local storage.
func (*Manager) Fetch ¶ added in v0.0.2
func (m *Manager) Fetch(remoteRef reference.RemoteRepository, options FetchOptions) error
Fetch fetches multiple version of the given repository reference. It starts by updating every HEAD tags and then finally, it downloads the given remote reference.
func (*Manager) LocalRepositoryExist ¶ added in v0.0.4
LocalRepositoryExist returns true if a local repository with the given name exist.
func (*Manager) Repositories ¶
func (m *Manager) Repositories() ([]*Repository, error)
Repositories returns the list of repositories
func (*Manager) Repository ¶
func (m *Manager) Repository(name reference.Named) (*Repository, error)
Repository returns the repository associated with the given name. An error is returned if local repository is missing or corrupted.
type PullOptions ¶ added in v0.0.4
PullOptions holds configuration options for pulling operations.
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
Repository is an object holding the history of a rootfs (OCI/Docker image).
func (*Repository) Add ¶ added in v0.0.4
func (r *Repository) Add(dest string, options AddOptions, sources ...string) error
Add commits the given source files to HEAD.
func (*Repository) AddTag ¶ added in v0.0.4
func (r *Repository) AddTag(tag reference.Tagged) error
AddTag adds the given tag to HEAD.
func (*Repository) Checkout ¶ added in v0.0.4
func (r *Repository) Checkout(tag reference.Tagged) error
Checkout moves repository's HEAD to the given reference tag.
func (*Repository) Commits ¶
func (r *Repository) Commits() ([]Commit, error)
Commits returns the commits history of this repository.
func (*Repository) Exec ¶ added in v0.0.4
func (r *Repository) Exec(options ExecOptions, cmd string, args ...string) error
func (*Repository) HeadRef ¶ added in v0.0.4
func (r *Repository) HeadRef() reference.LocalRepository
NameRef returns the underlying HEAD reference.
func (*Repository) HeadTags ¶ added in v0.0.4
func (r *Repository) HeadTags() []string
HeadTags returns other tags pointing to the same commit as HEAD.
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
Name returns the name of the repository.
func (*Repository) OtherTags ¶ added in v0.0.4
func (r *Repository) OtherTags() ([]string, error)
OtherTags returns tags associated to this repository without tags associated to HEAD.
func (*Repository) ReloadHead ¶ added in v0.0.4
func (r *Repository) ReloadHead() error
ReloadHead reloads underlying HEAD image.
func (*Repository) RemoveTag ¶ added in v0.0.4
func (r *Repository) RemoveTag(tag reference.Tagged) error
RemoveTag returns the given tag from HEAD.
func (*Repository) Unmount ¶ added in v0.0.2
func (r *Repository) Unmount() error
Unmount unmount the repository.