s3

package
v0.0.0-...-47edf51 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2017 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	AccessKeyId     string
	AccessKeySecret string
	BucketName      string
	BucketPrefix    string
	Region          string
}

Config defines configuration for s3 output.

type S3

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

S3 implements Collector.Ouput Interface. S3 allows the logs to be uploaded to S3 bucket with defined prefix.

func New

func New(config *Config) (*S3, error)

New returns *S3. It performs an authentication of the specified credentials and returns error if failed.

func (*S3) Put

func (s *S3) Put(f io.ReadSeeker, dst string) (string, error)

Put uploads the data from f io.ReadSeeker to S3 bucket with bucketprefix. Put uses s3manager to upload large files in parts concurrently. Put returns the URL of the file in the bucket (the url can be used to access the file only if the bucket permissions allow).

Jump to

Keyboard shortcuts

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