kopia lustrzana https://github.com/reiver/greatape
32 wiersze
451 B
Go
32 wiersze
451 B
Go
package test
|
|
|
|
import (
|
|
"errors"
|
|
|
|
. "github.com/reiver/greatape/components/api/protobuf"
|
|
. "github.com/reiver/greatape/components/contracts"
|
|
)
|
|
|
|
func echo(api IApi) error {
|
|
|
|
// Echo
|
|
{
|
|
input := &EchoRequest{
|
|
Document: &Document{
|
|
Content: "{}",
|
|
},
|
|
}
|
|
|
|
output, err := api.Echo(input)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
if output.Document.Content != input.Document.Content {
|
|
return errors.New("echo_failed")
|
|
}
|
|
}
|
|
|
|
return nil
|
|
}
|