service

package
v0.0.0-...-e6f8ebc Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Closer

type Closer interface {
	Close(ctx context.Context) error
}

Closer defines the required methods for a closable resource

type HTTPServer

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

HTTPServer defines the required methods from the HTTP server

type Initialiser

type Initialiser interface {
	DoGetHTTPServer(bindAddr string, router http.Handler) HTTPServer
}

Initialiser defines the methods to initialise external services

type Service

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

Service contains all the configs, server and clients to run the Dataset API

func New

func New(cfg *config.Configuration, mongoClient *mongo.Client) *Service

New creates a new service

func (*Service) Close

func (svc *Service) Close(ctx context.Context) error

Close gracefully shuts the service down in the required order, with timeout

func (*Service) Run

func (svc *Service) Run(ctx context.Context, recipeData map[string]models.Recipe, svcErrors chan error) (err error)

Run the service

Jump to

Keyboard shortcuts

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