33 lines
604 B
Go
33 lines
604 B
Go
package rpc
|
|
|
|
import (
|
|
"log"
|
|
)
|
|
|
|
type DiscoveryService struct {
|
|
}
|
|
|
|
type StartRequestParam struct {
|
|
Name string
|
|
Count int
|
|
}
|
|
|
|
type StartResponseParam struct {
|
|
Result int
|
|
}
|
|
|
|
func (ds *DiscoveryService) Start(req *StartRequestParam) (*StartResponseParam, error) {
|
|
log.Printf("DiscoveryService.Start param: Name[%s] Count[%d]", req.Name, req.Count)
|
|
res := &StartResponseParam{}
|
|
|
|
res.Result = 10 + req.Count
|
|
|
|
return res, nil
|
|
}
|
|
|
|
func (ds *DiscoveryService) Discovery(name string, req *StartRequestParam) error {
|
|
log.Printf("DiscoveryService.Discovery param: Name[%s] req[%v]", name, req)
|
|
|
|
return nil
|
|
}
|