RPC_Test

package
v0.0.0-...-0aa404c Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const ServiceName = "CalcService"

ServiceName 计算器服务名

Variables

This section is empty.

Functions

func RegisterCalcService

func RegisterCalcService(svc ServiceInterface) error

RegisterCalcService register the RPC service on svc

Types

type Calc

type Calc struct {
	Number1  float64
	Number2  float64
	Operator string
}

Calc 定义计算器对象,包括两个运算数

type ServiceInterface

type ServiceInterface interface {
	// CalcTwoNumber 对两个数进行运算
	CalcTwoNumber(request Calc, reply *float64) error
	// GetOperators 获取所有支持的运算
	GetOperators(request struct{}, reply *[]string) error
}

ServiceInterface 计算器服务接口

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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