service

package
v1.15.0 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2021 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dependencies added in v1.15.0

type Dependencies interface {
	DatasetClient(string) downloads.DatasetClient
	FilterClient(string) downloads.FilterClient
	ImageClient(string) downloads.ImageClient
	VaultClient(*config.Config) (content.VaultClient, error)
	S3Client(*config.Config) (content.S3Client, error)
	MongoClient(context.Context, *config.Config) (MongoClient, error)
	HealthCheck(*config.Config, string, string, string) (HealthChecker, error)
}

Dependencies holds constructors/factories for all external dependencies

type Download

type Download struct {
	// contains filtered or unexported fields
}

Download represents the configuration to run the download service

func New added in v1.15.0

func New(ctx context.Context, buildTime, gitCommit, version string, cfg *config.Config, deps Dependencies) (*Download, error)

New returns a new Download service with dependencies initialised based on cfg and deps.

func (Download) Start

func (d Download) Start(ctx context.Context)

Start should be called to manage the running of the download service

type HealthChecker added in v1.15.0

type HealthChecker interface {
	AddCheck(string, healthcheck.Checker) error
	Start(context.Context)
	Stop()
	Handler(http.ResponseWriter, *http.Request)
}

HealthChecker abstracts healthcheck.HealthCheck so we can create a mock. (interfaces for other dependencies are in ../downloads and ../content)

type MongoClient added in v1.15.0

type MongoClient interface {
	URI() string
	Close(context.Context) error
	Checker(context.Context, *healthcheck.CheckState) error
}

Mongo abstracts mongo.Mongo so we can create a mock.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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