service

package
v1.19.0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2024 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
	S3Client(*config.Config) (content.S3Client, error)
	FilesClient(*config.Config) downloads.FilesClient
	HealthCheck(*config.Config, string, string, string) (HealthChecker, error)
	HttpServer(*config.Config, http.Handler) HTTPServer
}

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) Close added in v1.16.0

func (d Download) Close(ctx context.Context) error

func (Download) Run added in v1.16.0

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

type HTTPServer added in v1.16.0

type HTTPServer interface {
	ListenAndServe() error
	Shutdown(ctx context.Context) error
}

HTTPServer defines the required methods from the HTTP server

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)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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