From 35c2178074babdae95a1cc70d0660f4349079a8e Mon Sep 17 00:00:00 2001 From: Andrey Smirnov Date: Wed, 19 Feb 2014 13:44:14 +0400 Subject: [PATCH] Add docblocks to method description in interfaces. [ci skip] --- aptly/interfaces.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/aptly/interfaces.go b/aptly/interfaces.go index 4f1d5549..a1bac33b 100644 --- a/aptly/interfaces.go +++ b/aptly/interfaces.go @@ -12,19 +12,29 @@ import ( // // PackagePool stores all the package files, deduplicating them. type PackagePool interface { + // Path returns full path to package file in pool given any name and hash of file contents Path(filename string, hashMD5 string) (string, error) + // RelativePath returns path relative to pool's root for package files given MD5 and original filename RelativePath(filename string, hashMD5 string) (string, error) + // FilepathList returns file paths of all the files in the pool FilepathList(progress Progress) ([]string, error) + // Remove deletes file in package pool returns its size Remove(path string) (size int64, err error) } // PublishedStorage is abstraction of filesystem storing all published repositories type PublishedStorage interface { + // PublicPath returns root of public part PublicPath() string + // MkDir creates directory recursively under public path MkDir(path string) error + // CreateFile creates file for writing under public path CreateFile(path string) (*os.File, error) + // RemoveDirs removes directory structure under public path RemoveDirs(path string) error + // LinkFromPool links package file from pool to dist's pool location LinkFromPool(prefix string, component string, poolDirectory string, sourcePool PackagePool, sourcePath string) (string, error) + // ChecksumsForFile proxies requests to utils.ChecksumsForFile, joining public path ChecksumsForFile(path string) (utils.ChecksumInfo, error) } @@ -48,9 +58,15 @@ type Progress interface { // Downloader is parallel HTTP fetcher type Downloader interface { + // Download starts new download task Download(url string, destination string, result chan<- error) + // DownloadWithChecksum starts new download task with checksum verification DownloadWithChecksum(url string, destination string, result chan<- error, expected utils.ChecksumInfo, ignoreMismatch bool) + // Pause pauses task processing Pause() + // Resume resumes task processing Resume() + // Shutdown stops downloader after current tasks are finished, + // but doesn't process rest of queue Shutdown() }