sources

package
v0.0.0-...-81ef2f2 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2020 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SourceEvents

func SourceEvents(source EventSource) interface{}

SourceEvents is the entry point for intializing client and generating events

Types

type EventSource

type EventSource interface {
	SetCtx()
	ConstructCloudEventsClient()
	GenerateEvents() interface{}
}

EventSource is a Interface for knative sink binding sources

type ObjectStoreConfig

type ObjectStoreConfig struct {
	Bucket    string `envconfig:"S3_BUCKET"`
	Key       string `envconfig:"S3_FILE_NAME"`
	Region    string `envconfig:"S3_REGION"`
	Access    string `envconfig:"S3_ACCESS_KEY"`
	Secret    string `envconfig:"S3_SECRET_KEY"`
	Endpoint  string `envconfig:"S3_URL"`
	ChunkSize string `envconfig:"DOWNLOAD_CHUNK_SIZE" default:"500000000"`
}

ObjectStoreConfig houses object store connection state

type Result

type Result struct {
	ErrorCount int
	SentCount  int
}

Result specifies type returned by S3Source

type S3Source

type S3Source struct {
	Sink       SinkConfig
	Connection ObjectStoreConfig
	// contains filtered or unexported fields
}

S3Source houses all the state related to the event

func (*S3Source) ConstructCloudEventsClient

func (source *S3Source) ConstructCloudEventsClient()

ConstructCloudEventsClient establishes HTTP client

func (*S3Source) GenerateEvents

func (source *S3Source) GenerateEvents() interface{}

GenerateEvents does the heavy lifting in the whole process

func (*S3Source) SetCtx

func (source *S3Source) SetCtx()

SetCtx set the context for the data transfer

type S3SourceData

type S3SourceData struct {
	Data string
}

S3SourceData specifies the shape of the data transmitted

type SinkConfig

type SinkConfig struct {
	URL           string `envconfig:"K_SINK"`
	CEOverrides   string `envconfig:"K_CE_OVERRIDES"`
	DumpCount     string `envconfig:"SINK_DUMP_COUNT" default:"100"`
	Retries       string `envconfig:"SINK_RETRY_COUNT" default:"3"`
	RetryInterval string `envconfig:"SINK_RETRY_INTERVAL" default:"1"`
}

SinkConfig houses the state of binding

Jump to

Keyboard shortcuts

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