Documentation ¶
Overview ¶
Package s3 handles publishing to Amazon S3
Index ¶
- Variables
- func ExpBackoff(try int)
- func NewClient(rt *ResilientTransport) *http.Client
- type DeadlineFunc
- type PublishedStorage
- func (storage *PublishedStorage) Filelist(prefix string) ([]string, error)
- func (storage *PublishedStorage) LinkFromPool(publishedDirectory string, sourcePool aptly.PackagePool, ...) error
- func (storage *PublishedStorage) MkDir(path string) error
- func (storage *PublishedStorage) PutFile(path string, sourceFilename string) error
- func (storage *PublishedStorage) Remove(path string) error
- func (storage *PublishedStorage) RemoveDirs(path string, progress aptly.Progress) error
- func (storage *PublishedStorage) RenameFile(oldName, newName string) error
- func (storage *PublishedStorage) String() string
- type ResilientTransport
- type RetryableFunc
- type WaitFunc
Constants ¶
This section is empty.
Variables ¶
var RetryingClient = NewClient(retryingTransport)
Exported default client
Functions ¶
func ExpBackoff ¶ added in v0.9.6
func ExpBackoff(try int)
func NewClient ¶ added in v0.9.6
func NewClient(rt *ResilientTransport) *http.Client
Convenience method for creating an http client
Types ¶
type DeadlineFunc ¶ added in v0.9.6
type PublishedStorage ¶
type PublishedStorage struct {
// contains filtered or unexported fields
}
PublishedStorage abstract file system with published files (actually hosted on S3)
func NewPublishedStorage ¶
func NewPublishedStorage(accessKey, secretKey, region, endpoint, bucket, defaultACL, prefix, storageClass, encryptionMethod string, plusWorkaround, disableMultiDel bool) (*PublishedStorage, error)
NewPublishedStorage creates new instance of PublishedStorage with specified S3 access keys, region and bucket name
func NewPublishedStorageRaw ¶
func NewPublishedStorageRaw(auth aws.Auth, region aws.Region, bucket, defaultACL, prefix, storageClass, encryptionMethod string, plusWorkaround, disabledMultiDel bool) (*PublishedStorage, error)
NewPublishedStorageRaw creates published storage from raw aws credentials
func (*PublishedStorage) Filelist ¶
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) PutFile ¶
func (storage *PublishedStorage) PutFile(path string, sourceFilename string) error
PutFile puts file into published storage at specified path
func (*PublishedStorage) Remove ¶
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 ¶
func (storage *PublishedStorage) RenameFile(oldName, newName string) error
RenameFile renames (moves) file
type ResilientTransport ¶ added in v0.9.6
type ResilientTransport struct { // Timeout is the maximum amount of time a dial will wait for // a connect to complete. // // The default is no timeout. // // With or without a timeout, the operating system may impose // its own earlier timeout. For instance, TCP timeouts are // often around 3 minutes. DialTimeout time.Duration // MaxTries, if non-zero, specifies the number of times we will retry on // failure. Retries are only attempted for temporary network errors or known // safe failures. MaxTries int ShouldRetry RetryableFunc Wait WaitFunc // contains filtered or unexported fields }