Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrFileNotFound = errors.New("File not found")
ErrFileNotFound signals that the requested file was not found
Functions ¶
Types ¶
type FileStorage ¶
type FileStorage struct {
// contains filtered or unexported fields
}
FileStorage allows to store data in a local directory
func (*FileStorage) Commit ¶
func (s *FileStorage) Commit() (err error)
Commit moves any temporary file accumulated so far to the permanent location
func (*FileStorage) NewReader ¶ added in v0.1.5
func (s *FileStorage) NewReader(filename string) (reader io.ReadCloser, err error)
NewReader returns a Reader for a file in the permanent location, returns ErrFileNotFound if the requested path was not found at all
func (*FileStorage) Recycle ¶
func (s *FileStorage) Recycle(filename string) (err error)
Recycle will copy a file from the permanent to the temporary location
func (*FileStorage) StoringMapper ¶
func (s *FileStorage) StoringMapper(filename string, checksum string, hash crypto.Hash) util.ReaderMapper
StoringMapper returns a mapper that will store read data to a temporary location specified by filename
type S3Storage ¶
type S3Storage struct {
// contains filtered or unexported fields
}
S3Storage allows to store data in an Amazon S3 bucket
func (*S3Storage) Commit ¶
Commit moves any temporary file accumulated so far to the permanent location
func (*S3Storage) NewReader ¶ added in v0.1.5
func (s *S3Storage) NewReader(filename string) (reader io.ReadCloser, err error)
NewReader returns a Reader for a file in the permanent location, returns ErrFileNotFound if the requested path was not found at all
func (*S3Storage) StoringMapper ¶
func (s *S3Storage) StoringMapper(filename string, checksum string, hash crypto.Hash) (mapper util.ReaderMapper)
StoringMapper returns a mapper that will store read data to a temporary location specified by filename
type Storage ¶
type Storage interface { // StoringMapper returns a mapper that will store read data to a temporary location specified by filename StoringMapper(filename string, checksum string, hash crypto.Hash) util.ReaderMapper // Commit moves any temporary file accumulated so far to the permanent location Commit() (err error) // NewReader returns a Reader for a file in the permanent location, returns ErrFileNotFound // if the requested path was not found at all NewReader(filename string) (reader io.ReadCloser, err error) // Recycle will copy a file from the permanent to the temporary location Recycle(filename string) (err error) }
Storage allows to store data in the form of files. Files are accumulated in a "temporary" location until Commit is called at that point any file in the temporary location is moved in the "permanent" location
func NewFileStorage ¶
NewFileStorage returns a new Storage given a local directory
type Syncer ¶
type Syncer struct { // URL of the repo this syncer syncs Url string // contains filtered or unexported fields }
Syncer syncs repos from an HTTP source to a Storage
type UnexpectedStatusCodeError ¶ added in v0.1.5
UnexpectedStatusCodeError signals a successful request that resulted in an unexpected status code
func (UnexpectedStatusCodeError) Error ¶ added in v0.1.5
func (e UnexpectedStatusCodeError) Error() string
type XMLChecksum ¶
XMLChecksum maps a <checksum> tag in repodata/<ID>-primary.xml.gz
type XMLData ¶
type XMLData struct { Type string `xml:"type,attr"` Location XMLLocation `xml:"location"` }
XMLData maps a <data> tag in repodata/repomd.xml
type XMLLocation ¶
type XMLLocation struct {
Href string `xml:"href,attr"`
}
XMLLocation maps a <location> tag in repodata/repomd.xml or repodata/<ID>-primary.xml.gz
type XMLMetaData ¶
type XMLMetaData struct {
Packages []XMLPackage `xml:"package"`
}
XMLMetaData maps a <metadata> tag in repodata/<ID>-primary.xml.gz
type XMLPackage ¶
type XMLPackage struct { Arch string `xml:"arch"` Location XMLLocation `xml:"location"` Checksum XMLChecksum `xml:"checksum"` }
XMLPackage maps a <package> tag in repodata/<ID>-primary.xml.gz