github.com/anycable/anycable-go@v1.5.1/protos/rpc.pb.grpchan.go (about) 1 // Code generated by protoc-gen-grpchan. DO NOT EDIT. 2 // source: rpc.proto 3 4 package anycable 5 6 import "github.com/fullstorydev/grpchan" 7 import "golang.org/x/net/context" 8 import "google.golang.org/grpc" 9 10 func RegisterHandlerRPC(reg grpchan.ServiceRegistry, srv RPCServer) { 11 reg.RegisterService(&_RPC_serviceDesc, srv) 12 } 13 14 type rPCChannelClient struct { 15 ch grpchan.Channel 16 } 17 18 func NewRPCChannelClient(ch grpchan.Channel) RPCClient { 19 return &rPCChannelClient{ch: ch} 20 } 21 22 func (c *rPCChannelClient) Connect(ctx context.Context, in *ConnectionRequest, opts ...grpc.CallOption) (*ConnectionResponse, error) { 23 out := new(ConnectionResponse) 24 err := c.ch.Invoke(ctx, "/anycable.RPC/Connect", in, out, opts...) 25 if err != nil { 26 return nil, err 27 } 28 return out, nil 29 } 30 31 func (c *rPCChannelClient) Command(ctx context.Context, in *CommandMessage, opts ...grpc.CallOption) (*CommandResponse, error) { 32 out := new(CommandResponse) 33 err := c.ch.Invoke(ctx, "/anycable.RPC/Command", in, out, opts...) 34 if err != nil { 35 return nil, err 36 } 37 return out, nil 38 } 39 40 func (c *rPCChannelClient) Disconnect(ctx context.Context, in *DisconnectRequest, opts ...grpc.CallOption) (*DisconnectResponse, error) { 41 out := new(DisconnectResponse) 42 err := c.ch.Invoke(ctx, "/anycable.RPC/Disconnect", in, out, opts...) 43 if err != nil { 44 return nil, err 45 } 46 return out, nil 47 }