endpoints

package
v0.0.0-...-fb1b0f6 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMetricInvalidRequestType = errors.New("RequestType has only four type: Add,Subtract,Multiply,Divide")
)
View Source
var (
	ErrStringInvalidRequestType = errors.New("RequestType has only four type: Add,Diff")
)

Functions

func MakeArithStringEndpoint

func MakeArithStringEndpoint(svc service.ServiceMetricString) endpoint.Endpoint

MakeArithStringEndpoint make endpoint

func MakeArithmeticEndpoint

func MakeArithmeticEndpoint(svc service.ServiceMetricMath) endpoint.Endpoint

MakeArithmeticEndpoint make endpoint

Types

type ArithStringEndpoint

type ArithStringEndpoint endpoint.Endpoint

CalculateEndpoint define endpoint

type ArithStringRequest

type ArithStringRequest struct {
	RequestType string `json:"request_type"`
	A           string `json:"a"`
	B           string `json:"b"`
}

ArithStringRequest define request struct

type ArithStringResponse

type ArithStringResponse struct {
	Result string `json:"result"`
	Error  error  `json:"error"`
}

ArithStringResponse define response struct

type ArithmeticEndpoint

type ArithmeticEndpoint endpoint.Endpoint

CalculateEndpoint define endpoint

type ArithmeticRequest

type ArithmeticRequest struct {
	RequestType string `json:"request_type"`
	A           int    `json:"a"`
	B           int    `json:"b"`
}

ArithmeticRequest define request struct

type ArithmeticResponse

type ArithmeticResponse struct {
	Result int   `json:"result"`
	Error  error `json:"error"`
}

ArithmeticResponse define response struct

type EndpointAll

type EndpointAll struct {
	MathEndpoint   endpoint.Endpoint
	StringEndpoint endpoint.Endpoint
}

Jump to

Keyboard shortcuts

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