mirror of
https://github.com/taigrr/wasm-experiments
synced 2025-01-18 04:03:21 -08:00
303 lines
9.8 KiB
Go
303 lines
9.8 KiB
Go
// Code generated by protoc-gen-go. DO NOT EDIT.
|
|
// source: proto/web.proto
|
|
|
|
package web // import "github.com/johanbrandhorst/wasm-experiments/grpc/proto"
|
|
|
|
/*
|
|
Web exposes a backend server over gRPC.
|
|
*/
|
|
|
|
import proto "github.com/golang/protobuf/proto"
|
|
import fmt "fmt"
|
|
import math "math"
|
|
|
|
import (
|
|
context "golang.org/x/net/context"
|
|
grpc "google.golang.org/grpc"
|
|
)
|
|
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
|
var _ = proto.Marshal
|
|
var _ = fmt.Errorf
|
|
var _ = math.Inf
|
|
|
|
// This is a compile-time assertion to ensure that this generated file
|
|
// is compatible with the proto package it is being compiled against.
|
|
// A compilation error at this line likely means your copy of the
|
|
// proto package needs to be updated.
|
|
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
|
|
|
|
type GetUserRequest struct {
|
|
UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *GetUserRequest) Reset() { *m = GetUserRequest{} }
|
|
func (m *GetUserRequest) String() string { return proto.CompactTextString(m) }
|
|
func (*GetUserRequest) ProtoMessage() {}
|
|
func (*GetUserRequest) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_web_fab68bbab7573337, []int{0}
|
|
}
|
|
func (m *GetUserRequest) XXX_Unmarshal(b []byte) error {
|
|
return xxx_messageInfo_GetUserRequest.Unmarshal(m, b)
|
|
}
|
|
func (m *GetUserRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
return xxx_messageInfo_GetUserRequest.Marshal(b, m, deterministic)
|
|
}
|
|
func (dst *GetUserRequest) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_GetUserRequest.Merge(dst, src)
|
|
}
|
|
func (m *GetUserRequest) XXX_Size() int {
|
|
return xxx_messageInfo_GetUserRequest.Size(m)
|
|
}
|
|
func (m *GetUserRequest) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_GetUserRequest.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_GetUserRequest proto.InternalMessageInfo
|
|
|
|
func (m *GetUserRequest) GetUserId() string {
|
|
if m != nil {
|
|
return m.UserId
|
|
}
|
|
return ""
|
|
}
|
|
|
|
type User struct {
|
|
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *User) Reset() { *m = User{} }
|
|
func (m *User) String() string { return proto.CompactTextString(m) }
|
|
func (*User) ProtoMessage() {}
|
|
func (*User) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_web_fab68bbab7573337, []int{1}
|
|
}
|
|
func (m *User) XXX_Unmarshal(b []byte) error {
|
|
return xxx_messageInfo_User.Unmarshal(m, b)
|
|
}
|
|
func (m *User) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
return xxx_messageInfo_User.Marshal(b, m, deterministic)
|
|
}
|
|
func (dst *User) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_User.Merge(dst, src)
|
|
}
|
|
func (m *User) XXX_Size() int {
|
|
return xxx_messageInfo_User.Size(m)
|
|
}
|
|
func (m *User) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_User.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_User proto.InternalMessageInfo
|
|
|
|
func (m *User) GetId() string {
|
|
if m != nil {
|
|
return m.Id
|
|
}
|
|
return ""
|
|
}
|
|
|
|
type GetUsersRequest struct {
|
|
NumUsers int64 `protobuf:"varint,1,opt,name=num_users,json=numUsers,proto3" json:"num_users,omitempty"`
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *GetUsersRequest) Reset() { *m = GetUsersRequest{} }
|
|
func (m *GetUsersRequest) String() string { return proto.CompactTextString(m) }
|
|
func (*GetUsersRequest) ProtoMessage() {}
|
|
func (*GetUsersRequest) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_web_fab68bbab7573337, []int{2}
|
|
}
|
|
func (m *GetUsersRequest) XXX_Unmarshal(b []byte) error {
|
|
return xxx_messageInfo_GetUsersRequest.Unmarshal(m, b)
|
|
}
|
|
func (m *GetUsersRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
return xxx_messageInfo_GetUsersRequest.Marshal(b, m, deterministic)
|
|
}
|
|
func (dst *GetUsersRequest) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_GetUsersRequest.Merge(dst, src)
|
|
}
|
|
func (m *GetUsersRequest) XXX_Size() int {
|
|
return xxx_messageInfo_GetUsersRequest.Size(m)
|
|
}
|
|
func (m *GetUsersRequest) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_GetUsersRequest.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_GetUsersRequest proto.InternalMessageInfo
|
|
|
|
func (m *GetUsersRequest) GetNumUsers() int64 {
|
|
if m != nil {
|
|
return m.NumUsers
|
|
}
|
|
return 0
|
|
}
|
|
|
|
func init() {
|
|
proto.RegisterType((*GetUserRequest)(nil), "web.GetUserRequest")
|
|
proto.RegisterType((*User)(nil), "web.User")
|
|
proto.RegisterType((*GetUsersRequest)(nil), "web.GetUsersRequest")
|
|
}
|
|
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
|
var _ context.Context
|
|
var _ grpc.ClientConn
|
|
|
|
// This is a compile-time assertion to ensure that this generated file
|
|
// is compatible with the grpc package it is being compiled against.
|
|
const _ = grpc.SupportPackageIsVersion4
|
|
|
|
// BackendClient is the client API for Backend service.
|
|
//
|
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
|
|
type BackendClient interface {
|
|
GetUser(ctx context.Context, in *GetUserRequest, opts ...grpc.CallOption) (*User, error)
|
|
GetUsers(ctx context.Context, in *GetUsersRequest, opts ...grpc.CallOption) (Backend_GetUsersClient, error)
|
|
}
|
|
|
|
type backendClient struct {
|
|
cc *grpc.ClientConn
|
|
}
|
|
|
|
func NewBackendClient(cc *grpc.ClientConn) BackendClient {
|
|
return &backendClient{cc}
|
|
}
|
|
|
|
func (c *backendClient) GetUser(ctx context.Context, in *GetUserRequest, opts ...grpc.CallOption) (*User, error) {
|
|
out := new(User)
|
|
err := c.cc.Invoke(ctx, "/web.Backend/GetUser", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *backendClient) GetUsers(ctx context.Context, in *GetUsersRequest, opts ...grpc.CallOption) (Backend_GetUsersClient, error) {
|
|
stream, err := c.cc.NewStream(ctx, &_Backend_serviceDesc.Streams[0], "/web.Backend/GetUsers", opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
x := &backendGetUsersClient{stream}
|
|
if err := x.ClientStream.SendMsg(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if err := x.ClientStream.CloseSend(); err != nil {
|
|
return nil, err
|
|
}
|
|
return x, nil
|
|
}
|
|
|
|
type Backend_GetUsersClient interface {
|
|
Recv() (*User, error)
|
|
grpc.ClientStream
|
|
}
|
|
|
|
type backendGetUsersClient struct {
|
|
grpc.ClientStream
|
|
}
|
|
|
|
func (x *backendGetUsersClient) Recv() (*User, error) {
|
|
m := new(User)
|
|
if err := x.ClientStream.RecvMsg(m); err != nil {
|
|
return nil, err
|
|
}
|
|
return m, nil
|
|
}
|
|
|
|
// BackendServer is the server API for Backend service.
|
|
type BackendServer interface {
|
|
GetUser(context.Context, *GetUserRequest) (*User, error)
|
|
GetUsers(*GetUsersRequest, Backend_GetUsersServer) error
|
|
}
|
|
|
|
func RegisterBackendServer(s *grpc.Server, srv BackendServer) {
|
|
s.RegisterService(&_Backend_serviceDesc, srv)
|
|
}
|
|
|
|
func _Backend_GetUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(GetUserRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(BackendServer).GetUser(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/web.Backend/GetUser",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(BackendServer).GetUser(ctx, req.(*GetUserRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Backend_GetUsers_Handler(srv interface{}, stream grpc.ServerStream) error {
|
|
m := new(GetUsersRequest)
|
|
if err := stream.RecvMsg(m); err != nil {
|
|
return err
|
|
}
|
|
return srv.(BackendServer).GetUsers(m, &backendGetUsersServer{stream})
|
|
}
|
|
|
|
type Backend_GetUsersServer interface {
|
|
Send(*User) error
|
|
grpc.ServerStream
|
|
}
|
|
|
|
type backendGetUsersServer struct {
|
|
grpc.ServerStream
|
|
}
|
|
|
|
func (x *backendGetUsersServer) Send(m *User) error {
|
|
return x.ServerStream.SendMsg(m)
|
|
}
|
|
|
|
var _Backend_serviceDesc = grpc.ServiceDesc{
|
|
ServiceName: "web.Backend",
|
|
HandlerType: (*BackendServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "GetUser",
|
|
Handler: _Backend_GetUser_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{
|
|
{
|
|
StreamName: "GetUsers",
|
|
Handler: _Backend_GetUsers_Handler,
|
|
ServerStreams: true,
|
|
},
|
|
},
|
|
Metadata: "proto/web.proto",
|
|
}
|
|
|
|
func init() { proto.RegisterFile("proto/web.proto", fileDescriptor_web_fab68bbab7573337) }
|
|
|
|
var fileDescriptor_web_fab68bbab7573337 = []byte{
|
|
// 235 bytes of a gzipped FileDescriptorProto
|
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x90, 0xb1, 0x4b, 0xc4, 0x30,
|
|
0x18, 0xc5, 0xed, 0x9d, 0x5c, 0xaf, 0xdf, 0x70, 0x07, 0x51, 0x54, 0x74, 0x91, 0x4e, 0x8a, 0xd8,
|
|
0x88, 0x6e, 0xea, 0x74, 0x8b, 0xb8, 0x16, 0x5c, 0x5c, 0x8e, 0xa6, 0xf9, 0x68, 0xab, 0x24, 0xa9,
|
|
0xf9, 0x12, 0xe2, 0x9f, 0x2f, 0x09, 0x57, 0x51, 0xb8, 0xed, 0xe5, 0xe5, 0xf7, 0x5e, 0x1e, 0x81,
|
|
0xf5, 0x68, 0x8d, 0x33, 0x3c, 0xa0, 0xa8, 0x92, 0x62, 0xf3, 0x80, 0xa2, 0xbc, 0x86, 0xd5, 0x0b,
|
|
0xba, 0x37, 0x42, 0x5b, 0xe3, 0x97, 0x47, 0x72, 0xec, 0x14, 0x72, 0x4f, 0x68, 0xb7, 0x83, 0x3c,
|
|
0xcb, 0x2e, 0xb3, 0xab, 0xa2, 0x5e, 0xc4, 0xe3, 0xab, 0x2c, 0x4f, 0xe0, 0x30, 0x72, 0x6c, 0x05,
|
|
0xb3, 0xdf, 0xbb, 0xd9, 0x20, 0xcb, 0x0a, 0xd6, 0xbb, 0x0a, 0x9a, 0x3a, 0x2e, 0xa0, 0xd0, 0x5e,
|
|
0x6d, 0x63, 0x90, 0x12, 0x39, 0xaf, 0x97, 0xda, 0xab, 0xc4, 0xdc, 0x77, 0x90, 0x6f, 0x9a, 0xf6,
|
|
0x13, 0xb5, 0x64, 0x37, 0x90, 0xef, 0xa2, 0xec, 0xa8, 0x8a, 0xcb, 0xfe, 0x6f, 0x39, 0x2f, 0x92,
|
|
0x19, 0x9d, 0xf2, 0x80, 0x71, 0x58, 0x4e, 0xef, 0xb0, 0xe3, 0xbf, 0x34, 0xed, 0xc3, 0xef, 0xb2,
|
|
0xcd, 0xf3, 0xfb, 0x63, 0x37, 0xb8, 0xde, 0x8b, 0xaa, 0x35, 0x8a, 0x7f, 0x98, 0xbe, 0xd1, 0xc2,
|
|
0x36, 0x5a, 0xf6, 0xc6, 0x92, 0xe3, 0xa1, 0x21, 0x75, 0x8b, 0xdf, 0x23, 0xda, 0x41, 0xa1, 0x76,
|
|
0xc4, 0x3b, 0x3b, 0xb6, 0x3c, 0x7d, 0xcd, 0x53, 0x40, 0x21, 0x16, 0x49, 0x3e, 0xfc, 0x04, 0x00,
|
|
0x00, 0xff, 0xff, 0xaf, 0xf7, 0xf4, 0x4f, 0x38, 0x01, 0x00, 0x00,
|
|
}
|