s3

package
v0.0.0-...-c2832fb Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2016 License: BSD-3-Clause Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SignatureHeaderKey = "cypress-signature"
	SignatureHeader    = "x-amz-meta-" + SignatureHeaderKey
)

Variables

View Source
var (
	ErrInvalidS3ACL     = errors.New("invalid s3 ACL")
	ErrInvalidAWSRegion = errors.New("invalid AWS region")
)
View Source
var (
	ErrCorruptSignature = errors.New("corrupt signature")
	ErrMissingSignature = errors.New("missing signature")
	ErrMissingETag      = errors.New("missing ETag to verify")
	ErrInvalidSignature = errors.New("invalid signature")
)

Functions

This section is empty.

Types

type Recv

type Recv struct {
	Dir       string `short:"d" long:"dir" description:"directory to use for intermediate data"`
	AccessKey string `short:"a" long:"access" description:"AWS access key"`
	SecretKey string `short:"s" long:"secret" description:"AWS secret key"`
	Bucket    string `short:"b" long:"bucket" description:"bucket to store data in"`

	Region string `short:"r" long:"region" description:"AWS region to use"`
}

func (*Recv) Execute

func (s *Recv) Execute(args []string) error

type S3

type S3 struct {
	ACL s3.ACL
	// contains filtered or unexported fields
}

func NewS3

func NewS3(dir, bucket string, params S3Params) (*S3, error)

func NewS3WithSpool

func NewS3WithSpool(spool *spool.Spool, bucket string, params S3Params) (*S3, error)

func (*S3) Close

func (s3 *S3) Close() error

func (*S3) CurrentFile

func (s *S3) CurrentFile() string

func (*S3) Flush

func (s3 *S3) Flush() error

func (*S3) LastFile

func (s3 *S3) LastFile() string

func (*S3) Receive

func (s3 *S3) Receive(m *cypress.Message) error

func (*S3) Rotate

func (s3 *S3) Rotate() error

func (*S3) SignWith

func (s *S3) SignWith(k *ecdsa.PrivateKey)

type S3Config

type S3Config struct {
	SignKey       string
	AllowUnsigned bool
}

type S3Generator

type S3Generator struct {
	Keys keystore.Keys

	// Indicates if we should process any unsigned logs seen
	AllowUnsigned bool
	// contains filtered or unexported fields
}

func NewS3Generator

func NewS3Generator(bucket string, auth aws.Auth, region aws.Region) (*S3Generator, error)

func (*S3Generator) Close

func (g *S3Generator) Close() error

func (*S3Generator) Generate

func (g *S3Generator) Generate() (*cypress.Message, error)

func (*S3Generator) LastSignature

func (g *S3Generator) LastSignature() *S3Signature

func (*S3Generator) List

func (g *S3Generator) List() *s3.ListResp

type S3Params

type S3Params struct {
	Config *cypress.Config
	ACL    s3.ACL
	Auth   aws.Auth
	Region aws.Region
}

func (*S3Params) Client

func (p *S3Params) Client() *s3.S3

func (*S3Params) S3Config

func (p *S3Params) S3Config() *S3Config

func (*S3Params) SignKey

func (p *S3Params) SignKey() (*ecdsa.PrivateKey, error)

type S3Plugin

type S3Plugin struct {
	Dir       string `description:"directory to store intermediate data in"`
	AccessKey string `description:"AWS access key"`
	SecretKey string `description:"AWS secret key"`
	Bucket    string `description:"S3 bucket + path to store streams in"`
	ACL       string `description:"S3 ACL of data written (output only)"`
	Region    string `description:"AWS region to use"`
}

func (*S3Plugin) Description

func (s *S3Plugin) Description() string

func (*S3Plugin) Generator

func (s *S3Plugin) Generator() (cypress.Generator, error)

func (*S3Plugin) Receiver

func (s *S3Plugin) Receiver() (cypress.Receiver, error)

type S3Signature

type S3Signature struct {
	Keys  keystore.Keys `json:"-"`
	KeyID string        `json:"key_id"`
	R     *big.Int      `json:"r"`
	S     *big.Int      `json:"s"`
}

func (*S3Signature) ValidateETag

func (sig *S3Signature) ValidateETag(resp *http.Response) error

type Send

type Send struct {
	Dir       string `short:"d" long:"dir" description:"directory to use for intermediate data"`
	AccessKey string `short:"a" long:"access" description:"AWS access key"`
	SecretKey string `short:"s" long:"secret" description:"AWS secret key"`
	Bucket    string `short:"b" long:"bucket" description:"bucket to store data in"`

	ACL    string `long:"acl" description:"ACL to apply to data"`
	Region string `short:"r" long:"region" description:"AWS region to use"`
}

func (*Send) Execute

func (s *Send) Execute(args []string) error

Jump to

Keyboard shortcuts

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