service

package
v0.0.0-...-bae3b6f Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StringServiceCommandName = "String.string"
	StringService            = "string"
)

Service constants

Variables

View Source
var (
	ErrHystrixFallbackExecute = errors.New("hystrix fall back execute")
)

Functions

This section is empty.

Types

type Service

type Service interface {
	// 远程调用 string-service 服务
	UseStringService(operationType, a, b string) (string, error)

	// 健康检查
	HealthCheck() bool
}

Service Define a service interface

func NewUseStringService

func NewUseStringService(client discover.DiscoveryClient, lb loadbalance.LoadBalance) Service

type ServiceMiddleware

type ServiceMiddleware func(Service) Service

ServiceMiddleware define service middleware

type StringResponse

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

StringResponse define response struct

type UseStringService

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

ArithmeticService implement Service interface

func (UseStringService) HealthCheck

func (s UseStringService) HealthCheck() bool

HealthCheck implement Service method 用于检查服务的健康状态,这里仅仅返回true。

func (UseStringService) UseStringService

func (s UseStringService) UseStringService(operationType, a, b string) (string, error)

Jump to

Keyboard shortcuts

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