service

package
v1.19.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DatasetClient

type DatasetClient interface {
	GetInstance(ctx context.Context, userAuthToken, serviceAuthToken, collectionID, instanceID, ifMatch string) (m dataset.Instance, eTag string, err error)
	PostInstanceDimensions(ctx context.Context, serviceAuthToken, instanceID string, data dataset.OptionPost, ifMatch string) (eTag string, err error)
	PutInstanceData(ctx context.Context, serviceAuthToken, instanceID string, data dataset.JobInstance, ifMatch string) (eTag string, err error)
}

DatasetClient is an interface to represent methods called to action upon Dataset REST interface

type DimensionExtracted

type DimensionExtracted struct {
	FileURL    string `avro:"file_url"`
	InstanceID string `avro:"instance_id"`
}

DimensionExtracted represents a kafka avro model for a dimension extracted file for an instance

type InputFileAvailable

type InputFileAvailable struct {
	FileURL    string `avro:"file_url"`
	InstanceID string `avro:"instance_id"`
}

InputFileAvailable represents a kafka avro model for an available input file fo an instance

func (*InputFileAvailable) S3URL

func (inputFileAvailable *InputFileAvailable) S3URL() (*s3client.S3Url, error)

S3URL parses the fileURL into an S3Url struct. s3:// prefix is interpreted as DNS-Alias-virtual-hosted style. Otherwise, path-style is assumed.

type KafkaProducer

type KafkaProducer interface {
	Channels() *kafka.ProducerChannels
	Close(ctx context.Context) (err error)
}

KafkaProducer is an interface to represent methods called to action upon Kafka to produce messages

type S3Client

type S3Client interface {
	Get(key string) (io.ReadCloser, *int64, error)
	GetWithPSK(key string, psk []byte) (io.ReadCloser, *int64, error)
	Checker(ctx context.Context, state *healthcheck.CheckState) error
}

S3Client is an interface to represent methods called to action upon AWS S3

type Service

type Service struct {
	AuthToken                  string
	DimensionExtractedProducer KafkaProducer
	EncryptionDisabled         bool
	DatasetClient              DatasetClient
	AwsSession                 *session.Session
	S3Clients                  map[string]S3Client
	VaultClient                VaultClient
	VaultPath                  string
}

Service handles incoming messages.

func (*Service) HandleMessage

func (svc *Service) HandleMessage(ctx context.Context, message kafka.Message) (string, error)

HandleMessage handles a message by sending requests to the dataset API before producing a new message to confirm successful completion

type VaultClient

type VaultClient interface {
	ReadKey(path, key string) (string, error)
}

VaultClient is an interface to represent methods called to action upon Vault

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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