s3acquisition

package
v1.6.2-rc3 Latest Latest
Warning

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

Go to latest
Published: May 27, 2024 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const PollMethodList = "list"
View Source
const PollMethodSQS = "sqs"
View Source
const SQSFormatEventBridge = "eventbridge"
View Source
const SQSFormatS3Notification = "s3notification"

Variables

This section is empty.

Functions

This section is empty.

Types

type S3Configuration

type S3Configuration struct {
	configuration.DataSourceCommonCfg `yaml:",inline"`
	AwsProfile                        *string `yaml:"aws_profile"`
	AwsRegion                         string  `yaml:"aws_region"`
	AwsEndpoint                       string  `yaml:"aws_endpoint"`
	BucketName                        string  `yaml:"bucket_name"`
	Prefix                            string  `yaml:"prefix"`
	Key                               string  `yaml:"-"` //Only for DSN acquisition
	PollingMethod                     string  `yaml:"polling_method"`
	PollingInterval                   int     `yaml:"polling_interval"`
	SQSName                           string  `yaml:"sqs_name"`
	SQSFormat                         string  `yaml:"sqs_format"`
	MaxBufferSize                     int     `yaml:"max_buffer_size"`
}

type S3Event

type S3Event struct {
	Version    string   `json:"version"`
	Id         string   `json:"id"`
	DetailType string   `json:"detail-type"`
	Source     string   `json:"source"`
	Account    string   `json:"account"`
	Time       string   `json:"time"`
	Region     string   `json:"region"`
	Resources  []string `json:"resources"`
	Detail     struct {
		Version         string `json:"version"`
		RequestId       string `json:"request-id"`
		Requester       string `json:"requester"`
		Reason          string `json:"reason"`
		SourceIpAddress string `json:"source-ip-address"`
		Bucket          struct {
			Name string `json:"name"`
		} `json:"bucket"`
		Object struct {
			Key       string `json:"key"`
			Size      int    `json:"size"`
			Etag      string `json:"etag"`
			Sequencer string `json:"sequencer"`
		} `json:"object"`
	} `json:"detail"`
}

For some reason, the aws sdk doesn't have a struct for this The one aws-lamdbda-go/events is only intended when using S3 Notification without event bridge

type S3Object

type S3Object struct {
	Key    string
	Bucket string
}

type S3Source

type S3Source struct {
	MetricsLevel int
	Config       S3Configuration
	// contains filtered or unexported fields
}

func (*S3Source) CanRun

func (s *S3Source) CanRun() error

func (*S3Source) Configure

func (s *S3Source) Configure(yamlConfig []byte, logger *log.Entry, metricsLevel int) error

func (*S3Source) ConfigureByDSN

func (s *S3Source) ConfigureByDSN(dsn string, labels map[string]string, logger *log.Entry, uuid string) error

func (*S3Source) Dump

func (s *S3Source) Dump() interface{}

func (*S3Source) GetAggregMetrics

func (s *S3Source) GetAggregMetrics() []prometheus.Collector

func (*S3Source) GetMetrics

func (s *S3Source) GetMetrics() []prometheus.Collector

func (*S3Source) GetMode

func (s *S3Source) GetMode() string

func (*S3Source) GetName

func (s *S3Source) GetName() string

func (*S3Source) GetUuid

func (s *S3Source) GetUuid() string

func (*S3Source) OneShotAcquisition

func (s *S3Source) OneShotAcquisition(out chan types.Event, t *tomb.Tomb) error

func (*S3Source) StreamingAcquisition

func (s *S3Source) StreamingAcquisition(out chan types.Event, t *tomb.Tomb) error

func (*S3Source) UnmarshalConfig

func (s *S3Source) UnmarshalConfig(yamlConfig []byte) error

Jump to

Keyboard shortcuts

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