s3

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: May 14, 2018 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package s3 handles publishing to Amazon S3

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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, sessionToken, region, endpoint, bucket, defaultACL, prefix,
	storageClass, encryptionMethod string, plusWorkaround, disableMultiDel, forceSigV2, debug bool) (*PublishedStorage, error)

NewPublishedStorage creates new instance of PublishedStorage with specified S3 access keys, region and bucket name

func NewPublishedStorageRaw

func NewPublishedStorageRaw(
	bucket, defaultACL, prefix, storageClass, encryptionMethod string,
	plusWorkaround, disabledMultiDel bool,
	config *aws.Config,
) (*PublishedStorage, error)

NewPublishedStorageRaw creates published storage from raw aws credentials

func (*PublishedStorage) FileExists added in v1.2.0

func (storage *PublishedStorage) FileExists(path string) (bool, error)

FileExists returns true if path exists

func (*PublishedStorage) Filelist

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

Filelist returns list of files under prefix

func (storage *PublishedStorage) HardLink(src string, dst string) error

HardLink using symlink functionality as hard links do not exist

func (*PublishedStorage) LinkFromPool

func (storage *PublishedStorage) LinkFromPool(publishedDirectory, baseName string, sourcePool aptly.PackagePool,
	sourcePath string, sourceChecksums utils.ChecksumInfo, 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 (storage *PublishedStorage) ReadLink(path string) (string, error)

ReadLink returns the symbolic link pointed to by path. This simply reads text file created with SymLink

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

func (*PublishedStorage) String

func (storage *PublishedStorage) String() string

String

func (storage *PublishedStorage) SymLink(src string, dst string) error

SymLink creates a copy of src file and adds link information as meta data

Jump to

Keyboard shortcuts

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