s3sink

package
v1.0.0-beta.4 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2021 License: Apache-2.0 Imports: 7 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 {
	Region          string `yaml:"region"`
	AccessKeyId     string `yaml:"accessKeyId"`
	SecretAccessKey string `yaml:"secretAccessKey"`
	Bucket          string `yaml:"bucket"`
	BucketDir       string `yaml:"bucketDir"`
}

type S3Manifest

type S3Manifest struct {
	Entries []S3ManifestEntry `json:"entries"`
}

type S3ManifestEntry

type S3ManifestEntry struct {
	URL       string `json:"url"`
	Mandatory bool   `json:"mandatory"`
}

type S3Sink

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

S3Sink is a library which can be used to upload data to s3

func NewS3Sink

func NewS3Sink(
	awsAccessKeyID string,
	awsSecretAccessKey string,
	s3Region string,
	s3Bucket string) (*S3Sink, error)

NewS3Sink is the factory method constructing a new S3Sink

func (*S3Sink) GetKeyURI

func (s *S3Sink) GetKeyURI(key string) string

func (*S3Sink) Upload

func (s *S3Sink) Upload(key string, bodyBuf *bytes.Buffer) error

Upload uploads the data stored in buffer to s3 in the specified key and clears the buffer

func (*S3Sink) UploadS3Manifest

func (s *S3Sink) UploadS3Manifest(key string, entries []S3ManifestEntry) error

Jump to

Keyboard shortcuts

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