Documentation ¶
Index ¶
- type Config
- type PackageServer
- func (p *PackageServer) ConfigurePackage(loc loc.Locator, confLoc loc.Locator, args []string) error
- func (p *PackageServer) CreatePackage(loc loc.Locator, data io.Reader, options ...pack.PackageOption) (*pack.PackageEnvelope, error)
- func (p *PackageServer) DeletePackage(loc loc.Locator) error
- func (p *PackageServer) DeleteRepository(repository string) error
- func (p *PackageServer) GetPackageManifest(loc loc.Locator) (*pack.Manifest, error)
- func (p *PackageServer) GetPackages(repository string) ([]pack.PackageEnvelope, error)
- func (p *PackageServer) GetRepositories() ([]string, error)
- func (p *PackageServer) GetRepository(repository string) (storage.Repository, error)
- func (p *PackageServer) PackageDownloadURL(loc loc.Locator) string
- func (p *PackageServer) PortalURL() string
- func (p *PackageServer) ReadPackage(loc loc.Locator) (*pack.PackageEnvelope, io.ReadCloser, error)
- func (p *PackageServer) ReadPackageEnvelope(loc loc.Locator) (*pack.PackageEnvelope, error)
- func (p *PackageServer) Unpack(loc loc.Locator, targetDir string) error
- func (p *PackageServer) UnpackWithOptions(loc loc.Locator, targetDir string, opts *dockerarchive.TarOptions) (err error)
- func (p *PackageServer) UnpackedPath(loc loc.Locator) (string, error)
- func (p *PackageServer) UpdatePackageLabels(loc loc.Locator, addLabels map[string]string, removeLabels []string) error
- func (p *PackageServer) UpsertPackage(loc loc.Locator, data io.Reader, options ...pack.PackageOption) (*pack.PackageEnvelope, error)
- func (p *PackageServer) UpsertRepository(repository string, expires time.Time) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // Backend is a storage backend for metadata, e.g. package // name, version, SHA hash Backend storage.Backend // Objects is BLOB storage Objects blob.Objects // DownloadURL sets up download URL used by the package service DownloadURL string // Clock is used to mock time in tests, if omitted, system time // will be used Clock timetools.TimeProvider // UnpackedDir is the path for unpacked packages UnpackedDir string }
Config represents package server configuration
type PackageServer ¶
type PackageServer struct {
// contains filtered or unexported fields
}
PackageServer manages BLOBs of data and their metadata as packages
func New ¶
func New(cfg Config) (*PackageServer, error)
func (*PackageServer) ConfigurePackage ¶
func (*PackageServer) CreatePackage ¶
func (p *PackageServer) CreatePackage(loc loc.Locator, data io.Reader, options ...pack.PackageOption) (*pack.PackageEnvelope, error)
CreatePackage creates a new package in existing repository
func (*PackageServer) DeletePackage ¶
func (p *PackageServer) DeletePackage(loc loc.Locator) error
DeletePackage removes package from all repository and deletes the package
func (*PackageServer) DeleteRepository ¶
func (p *PackageServer) DeleteRepository(repository string) error
DeleteRepository deletes repository and all its packages
func (*PackageServer) GetPackageManifest ¶
func (*PackageServer) GetPackages ¶
func (p *PackageServer) GetPackages(repository string) ([]pack.PackageEnvelope, error)
GetPackages returns a list of package in a given repository
func (*PackageServer) GetRepositories ¶
func (p *PackageServer) GetRepositories() ([]string, error)
GetRepositories repositories returns a list of repositories
func (*PackageServer) GetRepository ¶
func (p *PackageServer) GetRepository(repository string) (storage.Repository, error)
GetRepository returns nil if repository exists, error otherwise
func (*PackageServer) PackageDownloadURL ¶
func (p *PackageServer) PackageDownloadURL(loc loc.Locator) string
PackageDownloadURL returns download url for this package
func (*PackageServer) PortalURL ¶
func (p *PackageServer) PortalURL() string
func (*PackageServer) ReadPackage ¶
func (p *PackageServer) ReadPackage(loc loc.Locator) (*pack.PackageEnvelope, io.ReadCloser, error)
ReadPackage package opens and returns package contents
func (*PackageServer) ReadPackageEnvelope ¶
func (p *PackageServer) ReadPackageEnvelope(loc loc.Locator) (*pack.PackageEnvelope, error)
ReadPackageEnvelope returns package envelope without reading the BLOB
func (*PackageServer) Unpack ¶
func (p *PackageServer) Unpack(loc loc.Locator, targetDir string) error
func (*PackageServer) UnpackWithOptions ¶
func (p *PackageServer) UnpackWithOptions(loc loc.Locator, targetDir string, opts *dockerarchive.TarOptions) (err error)
UnpackWithOptions unpacks the package specified with loc in targetDir using opts for extraction
func (*PackageServer) UnpackedPath ¶
func (p *PackageServer) UnpackedPath(loc loc.Locator) (string, error)
func (*PackageServer) UpdatePackageLabels ¶
func (p *PackageServer) UpdatePackageLabels(loc loc.Locator, addLabels map[string]string, removeLabels []string) error
UpdatePackageLabels updates package's labels
func (*PackageServer) UpsertPackage ¶
func (p *PackageServer) UpsertPackage(loc loc.Locator, data io.Reader, options ...pack.PackageOption) (*pack.PackageEnvelope, error)
UpsertPackage upserts package and repository
func (*PackageServer) UpsertRepository ¶
func (p *PackageServer) UpsertRepository(repository string, expires time.Time) error
UpsertRepository creates or updates repository, note that expiration parameter will not be updated if repository already exists