s3apt

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2017 License: MIT Imports: 22 Imported by: 1

README

apt-method-s3 or s3apt

Table of Contents
  1. License
  2. Requirements
  3. Configuration
  4. Usage
  5. Testing
  6. Contribution

apt-method-s3

Allow to have a privately hosted apt repository on S3. Access keys are read from any standard AWS credentials source. If an instance role is used then the s3 method transport will attempt to determine the AWS regions auto-magically from the metsadata.

When using an instance role for credentials to the s3 bucket no other configuration is required.

License

See LICENSE file.

Requirements

Additional package dependencies (except installed by default in Debian)
  1. ca-certificates is required

Configuration

None

Usage

Install the .deb package from the releases page. The bucket repo should be specified using an s3:// prefix, for example:

deb s3://aptbucketname/repo/ trusty main contrib non-free

Testing

The module will run in interactive mode. It accepts on stdin and outputs on stdout. The messages it accepts on stdin are in the following format and documented here.

600 URI Acquire
URI:s3://my-s3-repository/project-a/dists/trusty/main/binary-amd64/Packages
Filename:Packages.downloaded
Fail-Ignore:true
Index-File:true

This message will trigger an s3 get from the above bucket and key and save it to Filename.

Contribution

If you want to contribute a PR please do so - if the work is substantial I advise talking about it first as an opened issue.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

type Message struct {
	Capability int

	FailIgnore     bool       `output:"Fail-Ignore"`
	Filename       string     `output:"Filename"`
	IndexFile      bool       `output:"Index-File"`
	LastModified   *time.Time `output:"Last-Modified"`
	MD5Hash        string     `output:"MD5-Hash"`
	MD5SumHash     string     `output:"MD5Sum-Hash"`
	SHA256Hash     string     `output:"SHA256-Hash"`
	SHA512Hash     string     `output:"SHA512-Hash"`
	Message        string     `output:"Message"`
	SingleInstance bool       `output:"Single-Instance"`
	Size           int        `output:"Size"`
	Uri            string     `output:"URI"`
	Version        string     `output:"Version"`
	// contains filtered or unexported fields
}

func (*Message) Output

func (m *Message) Output() (output string, err error)

func (*Message) Set

func (m *Message) Set(key string, value string) (err error)

type Method

type Method struct {
	// contains filtered or unexported fields
}

func NewMethod

func NewMethod(input *os.File, output *os.File, session *Session) *Method

func (*Method) Capabilities

func (m *Method) Capabilities(version string)

func (*Method) ParseCapability

func (m *Method) ParseCapability(line string) (capability int, err error)

func (*Method) ParseKV

func (m *Method) ParseKV(line string) (key string, value string, err error)

func (*Method) Process

func (m *Method) Process(message *Message) (err error)

func (*Method) Send

func (m *Method) Send(message *Message)

func (*Method) SendExitError

func (m *Method) SendExitError(err error)

type Session

type Session struct {
	// contains filtered or unexported fields
}

func NewS3Apt

func NewS3Apt() *Session

func (*Session) Get

func (s *Session) Get(uri string, filename string, method *Method) (err error)

func (*Session) SetRegion

func (s *Session) SetRegion(uri string) (err error)

Directories

Path Synopsis
cmd
s3

Jump to

Keyboard shortcuts

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