s3acquisition

package
v1.7.4 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2025 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PollMethodList = "list"
	PollMethodSQS  = "sqs"
)
View Source
const (
	SQSFormatEventBridge    = "eventbridge"
	SQSFormatS3Notification = "s3notification"
	SQSFormatSNS            = "sns"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration added in v1.7.4

type Configuration 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 S3API added in v1.7.1

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 SNSEvent added in v1.6.10

type SNSEvent struct {
	Message string `json:"Message"`
}

For events that are published to SQS by SNS We only care about the message itself, the other SNS metadata are not needed

type SQSAPI added in v1.7.1

type SQSAPI interface {
	ReceiveMessage(ctx context.Context, params *sqs.ReceiveMessageInput, optFns ...func(*sqs.Options)) (*sqs.ReceiveMessageOutput, error)
	DeleteMessage(ctx context.Context, params *sqs.DeleteMessageInput, optFns ...func(*sqs.Options)) (*sqs.DeleteMessageOutput, error)
}

type Source added in v1.7.4

type Source struct {
	Config Configuration
	// contains filtered or unexported fields
}

func (*Source) CanRun added in v1.7.4

func (*Source) CanRun() error

func (*Source) Configure added in v1.7.4

func (s *Source) Configure(ctx context.Context, yamlConfig []byte, logger *log.Entry, _ metrics.AcquisitionMetricsLevel) error

func (*Source) ConfigureByDSN added in v1.7.4

func (s *Source) ConfigureByDSN(ctx context.Context, dsn string, labels map[string]string, logger *log.Entry, uuid string) error

func (*Source) Dump added in v1.7.4

func (s *Source) Dump() any

func (*Source) GetAggregMetrics added in v1.7.4

func (*Source) GetAggregMetrics() []prometheus.Collector

func (*Source) GetMetrics added in v1.7.4

func (*Source) GetMetrics() []prometheus.Collector

func (*Source) GetMode added in v1.7.4

func (s *Source) GetMode() string

func (*Source) GetName added in v1.7.4

func (*Source) GetName() string

func (*Source) GetUuid added in v1.7.4

func (s *Source) GetUuid() string

func (*Source) OneShotAcquisition added in v1.7.4

func (s *Source) OneShotAcquisition(ctx context.Context, out chan pipeline.Event, t *tomb.Tomb) error

func (*Source) StreamingAcquisition added in v1.7.4

func (s *Source) StreamingAcquisition(ctx context.Context, out chan pipeline.Event, t *tomb.Tomb) error

func (*Source) UnmarshalConfig added in v1.7.4

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

Jump to

Keyboard shortcuts

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