libocitree

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HeadTag = "HEAD"
)

Variables

View Source
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")
)
View Source
var (
	ErrLocalRepositoryAlreadyExist = errors.New("local repository with the same name already exist")
)

Functions

func ParseRemoteRepoReference

func ParseRemoteRepoReference(ref string) (reference.Named, error)

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

func ParseRepoName(repoName string) (reference.Named, error)

ParseRepoName parses the given repository name and returns if it is a valid name. An error is returned if the reference is tagged.

func ParseRepoReference

func ParseRepoReference(ref string) (reference.Named, error)

ParseRepoReference parses the given repository reference and returns it if valid.

Types

type Commit

type Commit struct {
	// contains filtered or unexported fields
}

Commit define the history of a single layer.

func (*Commit) Comment

func (c *Commit) Comment() string

Comment returns the comment associated to this commit.

func (*Commit) CreatedBy

func (c *Commit) CreatedBy() string

CreatedBy returns the operations that created this commit.

func (*Commit) CreationDate

func (c *Commit) CreationDate() *time.Time

CreationDate returns the creation date of the commit.

func (*Commit) Empty

func (c *Commit) Empty() bool

Empty returns true if this commit doesn't correspond to an actual layer in rootfs.

func (*Commit) ID

func (c *Commit) ID() string

ID returns the ID associated to this commit.

func (*Commit) Size

func (c *Commit) Size() int64

Size returns the size of rootfs change contained in this commit.

func (*Commit) Tags

func (c *Commit) Tags() []string

Tags returns the tags associated to this commit.

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager defines a repositories manager.

func NewManagerFromStore

func NewManagerFromStore(store storage.Store, sysctx *types.SystemContext) (*Manager, error)

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) Checkout

func (m *Manager) Checkout(refStr string) error

Checkout moves repository's HEAD to the given reference.

func (*Manager) CheckoutByRef

func (m *Manager) CheckoutByRef(ref reference.Named) error

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) Clone

func (m *Manager) Clone(name string) error

Clone clones remote repository with the given name to local storage.

func (*Manager) CloneByNamedRef

func (m *Manager) CloneByNamedRef(named reference.Named) error

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) ID

func (r *Repository) ID() string

ID returns the ID of the image.

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.

Jump to

Keyboard shortcuts

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