-
Notifications
You must be signed in to change notification settings - Fork 0
/
event.go
41 lines (32 loc) · 821 Bytes
/
event.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// Code generated by goctl. DO NOT EDIT!
// Source: hi.proto
package client
import (
"context"
"github.com/jageros/goctl/example/rpc/hi/pb/hi"
"github.com/zeromicro/go-zero/zrpc"
"google.golang.org/grpc"
)
type (
EventReq = hi.EventReq
EventResp = hi.EventResp
HelloReq = hi.HelloReq
HelloResp = hi.HelloResp
HiReq = hi.HiReq
HiResp = hi.HiResp
Event interface {
AskQuestion(ctx context.Context, in *EventReq, opts ...grpc.CallOption) (*EventResp, error)
}
defaultEvent struct {
cli zrpc.Client
}
)
func NewEvent(cli zrpc.Client) Event {
return &defaultEvent{
cli: cli,
}
}
func (m *defaultEvent) AskQuestion(ctx context.Context, in *EventReq, opts ...grpc.CallOption) (*EventResp, error) {
client := hi.NewEventClient(m.cli.Conn())
return client.AskQuestion(ctx, in, opts...)
}