endpoints

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: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InstrumentingMiddleware

func InstrumentingMiddleware(duration metrics.Histogram) endpoint.Middleware

func MakeCreateCustomerEndpoint

func MakeCreateCustomerEndpoint(s service.Service) endpoint.Endpoint

MakeCreateCustomerEndpoint returns an endpoint via the given service.

func MakeGetCustomerByNameEndpoint

func MakeGetCustomerByNameEndpoint(s service.Service) endpoint.Endpoint

MakeCreateCustomerEndpoint returns an endpoint via the given service.

func MakeHealthEndpoint

func MakeHealthEndpoint(s service.Service) endpoint.Endpoint

MakeHealthEndpoint returns current health of the given service.

Types

type CreateCustomerRequest

type CreateCustomerRequest struct {
	Name        string  `json:"name"`
	CreditLimit float64 `json:"credit_limit"`
}

type CreateCustomerResponse

type CreateCustomerResponse struct {
	CustomerID string `json:"customer_id"`
	Err        error  `json:"err"`
}

type Endpoints

type Endpoints struct {
	CreateCustomerEndpoint endpoint.Endpoint
	GetByNameEndpoint      endpoint.Endpoint
	HealthEndpoint         endpoint.Endpoint
}

Endpoints collects the endpoints that comprise the Service.

func MakeEndpoints

func MakeEndpoints(s service.Service, duration metrics.Histogram, tracer stdopentracing.Tracer) Endpoints

MakeEndpoints returns an Endpoints structure, where each endpoint is backed by the given service.

type GetCustomerByNameRequest

type GetCustomerByNameRequest struct {
	Name string `json:"name"`
}

type GetCustomerByNameResponse

type GetCustomerByNameResponse struct {
	Customer domain.Customer `json:"customer"`
	Err      error           `json:"err"`
}

type HealthResponse

type HealthResponse struct {
	Health []service.Health `json:"health"`
}

Jump to

Keyboard shortcuts

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