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 server // import "github.com/johanbrandhorst/wasm-experiments/grpc/proto/server"
|
|
|
|
/*
|
|
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_87670d45010119fa, []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_87670d45010119fa, []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_87670d45010119fa, []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_87670d45010119fa) }
|
|
|
|
var fileDescriptor_web_87670d45010119fa = []byte{
|
|
// 236 bytes of a gzipped FileDescriptorProto
|
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x90, 0xc1, 0x4b, 0xc3, 0x30,
|
|
0x18, 0xc5, 0xdd, 0x26, 0xeb, 0xfa, 0x1d, 0x36, 0x88, 0xa2, 0xa2, 0x17, 0xe9, 0x49, 0x11, 0x1b,
|
|
0xd1, 0xb3, 0x08, 0xbb, 0x88, 0xd7, 0x82, 0x17, 0x2f, 0xa3, 0x69, 0x3e, 0xda, 0x2a, 0x49, 0xea,
|
|
0xf7, 0x25, 0xd6, 0x3f, 0x5f, 0x12, 0x37, 0x51, 0xf0, 0x96, 0xf7, 0xf2, 0x7b, 0x2f, 0x8f, 0xc0,
|
|
0x6a, 0x20, 0xe7, 0x9d, 0x1c, 0x51, 0x95, 0xe9, 0x24, 0x66, 0x23, 0xaa, 0xe2, 0x12, 0x96, 0x8f,
|
|
0xe8, 0x9f, 0x19, 0xa9, 0xc2, 0xf7, 0x80, 0xec, 0xc5, 0x31, 0x64, 0x81, 0x91, 0x36, 0xbd, 0x3e,
|
|
0x99, 0x9c, 0x4f, 0x2e, 0xf2, 0x6a, 0x1e, 0xe5, 0x93, 0x2e, 0x8e, 0x60, 0x3f, 0x72, 0x62, 0x09,
|
|
0xd3, 0x9f, 0xbb, 0x69, 0xaf, 0x8b, 0x12, 0x56, 0xdb, 0x0a, 0xde, 0x75, 0x9c, 0x41, 0x6e, 0x83,
|
|
0xd9, 0xc4, 0x20, 0x27, 0x72, 0x56, 0x2d, 0x6c, 0x30, 0x89, 0xb9, 0x6d, 0x21, 0x5b, 0xd7, 0xcd,
|
|
0x1b, 0x5a, 0x2d, 0xae, 0x20, 0xdb, 0x46, 0xc5, 0x41, 0x19, 0x97, 0xfd, 0xdd, 0x72, 0x9a, 0x27,
|
|
0x33, 0x3a, 0xc5, 0x9e, 0x90, 0xb0, 0xd8, 0xbd, 0x23, 0x0e, 0x7f, 0xd3, 0xfc, 0x1f, 0x7e, 0x33,
|
|
0x59, 0x3f, 0xbc, 0xdc, 0xb7, 0xbd, 0xef, 0x82, 0x2a, 0x1b, 0x67, 0xe4, 0xab, 0xeb, 0x6a, 0xab,
|
|
0xa8, 0xb6, 0xba, 0x73, 0xc4, 0x5e, 0x8e, 0x35, 0x9b, 0x6b, 0xfc, 0x1c, 0x90, 0x7a, 0x83, 0xd6,
|
|
0xb3, 0x6c, 0x69, 0x68, 0xe4, 0xf7, 0x27, 0x31, 0xd2, 0x07, 0x92, 0x9a, 0x27, 0x75, 0xf7, 0x15,
|
|
0x00, 0x00, 0xff, 0xff, 0x75, 0x28, 0x26, 0x8f, 0x3b, 0x01, 0x00, 0x00,
|
|
}
|