files

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2014 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package files handles operation on filesystem for both public pool and published files

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PackagePool

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

PackagePool is deduplicated storage of package files on filesystem

func NewPackagePool

func NewPackagePool(root string) *PackagePool

NewPackagePool creates new instance of PackagePool which specified root

func (*PackagePool) FilepathList

func (pool *PackagePool) FilepathList(progress aptly.Progress) ([]string, error)

FilepathList returns file paths of all the files in the pool

func (*PackagePool) Import

func (pool *PackagePool) Import(path string, hashMD5 string) error

Import copies file into package pool

func (*PackagePool) Path

func (pool *PackagePool) Path(filename string, hashMD5 string) (string, error)

Path returns full path to package file in pool given any name and hash of file contents

func (*PackagePool) RelativePath

func (pool *PackagePool) RelativePath(filename string, hashMD5 string) (string, error)

RelativePath returns path relative to pool's root for package files given MD5 and original filename

func (*PackagePool) Remove

func (pool *PackagePool) Remove(path string) (size int64, err error)

Remove deletes file in package pool returns its size

type PublishedStorage

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

PublishedStorage abstract file system with public dirs (published repos)

func NewPublishedStorage

func NewPublishedStorage(root string) *PublishedStorage

NewPublishedStorage creates new instance of PublishedStorage which specified root

func (*PublishedStorage) ChecksumsForFile

func (storage *PublishedStorage) ChecksumsForFile(path string) (utils.ChecksumInfo, error)

ChecksumsForFile proxies requests to utils.ChecksumsForFile, joining public path

func (*PublishedStorage) CreateFile

func (storage *PublishedStorage) CreateFile(path string) (*os.File, error)

CreateFile creates file for writing under public path

func (*PublishedStorage) LinkFromPool

func (storage *PublishedStorage) LinkFromPool(prefix string, component string, poolDirectory string, sourcePool aptly.PackagePool, sourcePath string) (string, error)

LinkFromPool links package file from pool to dist's pool location

prefix is publishing prefix for this repo (e.g. empty or "ppa/") component is component name when publishing (e.g. main) poolDirectory is desired location in pool (like liba/libav/) sourcePool is instance of aptly.PackagePool sourcePath is filepath to package file in package pool

LinkFromPool returns relative path for the published file to be included in package index

func (*PublishedStorage) MkDir

func (storage *PublishedStorage) MkDir(path string) error

MkDir creates directory recursively under public path

func (*PublishedStorage) PublicPath

func (storage *PublishedStorage) PublicPath() string

PublicPath returns root of public part

func (*PublishedStorage) RemoveDirs

func (storage *PublishedStorage) RemoveDirs(path string) error

RemoveDirs removes directory structure under public path

Jump to

Keyboard shortcuts

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