service

package
v0.0.0-...-b05fc82 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = fmt.Errorf("%s", "not found")

ErrNotFound is returned when there is no customer for a given ID.

Functions

This section is empty.

Types

type Health

type Health struct {
	Service string `json:"service"`
	Status  string `json:"status"`
	Time    string `json:"time"`
}

Health describes the health of a service

type Middleware

type Middleware func(Service) Service

Middleware decorates a Service.

func InstrumentingSvcMiddleware

func InstrumentingSvcMiddleware(customerCounter metrics.Counter) Middleware

func LoggingMiddleware

func LoggingMiddleware(logger log.Logger) Middleware

LoggingMiddleware logs method calls, parameters, results, and elapsed time.

type Service

type Service interface {
	Create(context.Context, string, float64) (string, error)
	GetByName(context.Context, string) (*domain.Customer, error) // GET /tags
	Health() []Health                                            // GET /health
}

Service is the customer service, providing read operations on a customer

func NewCustomerService

func NewCustomerService(db infrastructure.CustomerRepositoryInterface, customerCounter metrics.Counter, logger log.Logger) Service

NewCustomersService returns an implementation of the Service interface,

Jump to

Keyboard shortcuts

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