pkg

package
v0.0.0-...-e1dc571 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrRedisQueueEmpty = errors.New("redis queue is empty")
)

Functions

func RunAllWorkers

func RunAllWorkers(cfg *config.Config) (err error)

RunClientWorkers start all the workers to fetch and push the satellite images to the appropriate S3 bucket.

Types

type QueueElement

type QueueElement struct {
	// The longitude coordinate of the location.
	Longitude float64 `json:"longitude"`
	// The latitude coordinate of the location.
	Latitude float64 `json:"latitude"`
	// The Accident labels.
	Labels map[string]string `json:"labels"`
}

A representation of an element retrieved from the Redis queue.

type SatelitteImage

type SatelitteImage struct {
	// The ID of the satellite image.
	ID string
	// The longitude coordinate of the location.
	Longitude float64
	// The latitude coordinate of the location.
	Latitude float64
	// The labels of the sattelite image.
	Labels map[string]string
	// The downloaded image as raw bytes.
	Image []byte
}

A representation of an accident location.

type WorkerConf

type WorkerConf struct {
	// The ID of the worker.
	ID string
	// The ID of the current loading.
	LoadingID string
	// The configuration for the request to the Google API.
	GoogleAPI *config.GoogleAPIConfig
	// The configuration of the connection to the Redis server.
	Redis *config.RedisConfig
	// The configuration of the S3 Bucket connection.
	S3 *config.S3Config
}

The configuration of a worker.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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