files

package
Version: v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 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) Filelist added in v0.5.1

func (storage *PublishedStorage) Filelist(prefix string) ([]string, error)

Filelist returns list of files under prefix

func (*PublishedStorage) LinkFromPool

func (storage *PublishedStorage) LinkFromPool(publishedDirectory string, sourcePool aptly.PackagePool,
	sourcePath, sourceMD5 string, force bool) error

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

publishedDirectory is desired location in pool (like prefix/pool/component/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) PutFile added in v0.7.1

func (storage *PublishedStorage) PutFile(path string, sourceFilename string) error

PutFile puts file into published storage at specified path

func (*PublishedStorage) Remove added in v0.5.1

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

Remove removes single file under public path

func (*PublishedStorage) RemoveDirs

func (storage *PublishedStorage) RemoveDirs(path string, progress aptly.Progress) error

RemoveDirs removes directory structure under public path

func (*PublishedStorage) RenameFile added in v0.5.1

func (storage *PublishedStorage) RenameFile(oldName, newName string) error

RenameFile renames (moves) file

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL