endpoint

package
v0.0.0-...-2816995 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2022 License: MIT Imports: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidRequestType = errors.New("RequestType has only two type: Concat, Diff")
)

Functions

func MakeHealthCheckEndpoint

func MakeHealthCheckEndpoint(svc service.Service) endpoint.Endpoint

MakeHealthCheckEndpoint 创建健康检查Endpoint

func MakeStringEndpoint

func MakeStringEndpoint(ctx context.Context, svc service.Service) endpoint.Endpoint

MakeStringEndpoint make endpoint

Types

type HealthRequest

type HealthRequest struct{}

HealthRequest 健康检查请求结构

type HealthResponse

type HealthResponse struct {
	Status bool `json:"status"`
}

HealthResponse 健康检查响应结构

type StringEndpoints

type StringEndpoints struct {
	StringEndpoint      endpoint.Endpoint
	HealthCheckEndpoint endpoint.Endpoint
}

StringEndpoint define endpoint

func (StringEndpoints) Concat

func (se StringEndpoints) Concat(a, b string) (string, error)

func (StringEndpoints) Diff

func (se StringEndpoints) Diff(ctx context.Context, a, b string) (string, error)

func (StringEndpoints) HealthCheck

func (StringEndpoints) HealthCheck() bool

type StringRequest

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

StringRequest define request struct

type StringResponse

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

StringResponse define response struct

Jump to

Keyboard shortcuts

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