cutego/internal/examples/grpc/hello_world2/profile.pb.go
therecipe de33377ed6 Merge pull request #286 from kenshaw/fix-grpc-examples
Fixing import paths for grpc-ecosystem
2017-04-12 16:47:20 +02:00

305 lines
10 KiB
Go

// Code generated by protoc-gen-go.
// source: profile.proto
// DO NOT EDIT!
package main
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import _ "github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis/google/api"
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
type ProfileMessage_ProfileType int32
const (
ProfileMessage_USER ProfileMessage_ProfileType = 0
ProfileMessage_ADMIN ProfileMessage_ProfileType = 1
)
var ProfileMessage_ProfileType_name = map[int32]string{
0: "USER",
1: "ADMIN",
}
var ProfileMessage_ProfileType_value = map[string]int32{
"USER": 0,
"ADMIN": 1,
}
func (x ProfileMessage_ProfileType) String() string {
return proto.EnumName(ProfileMessage_ProfileType_name, int32(x))
}
func (ProfileMessage_ProfileType) EnumDescriptor() ([]byte, []int) {
return fileDescriptor1, []int{2, 0}
}
type EmptyMessage struct {
}
func (m *EmptyMessage) Reset() { *m = EmptyMessage{} }
func (m *EmptyMessage) String() string { return proto.CompactTextString(m) }
func (*EmptyMessage) ProtoMessage() {}
func (*EmptyMessage) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{0} }
type IDMessage struct {
Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
}
func (m *IDMessage) Reset() { *m = IDMessage{} }
func (m *IDMessage) String() string { return proto.CompactTextString(m) }
func (*IDMessage) ProtoMessage() {}
func (*IDMessage) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{1} }
func (m *IDMessage) GetId() string {
if m != nil {
return m.Id
}
return ""
}
type ProfileMessage struct {
Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
ProfileType ProfileMessage_ProfileType `protobuf:"varint,2,opt,name=profile_type,json=profileType,enum=helloworld.ProfileMessage_ProfileType" json:"profile_type,omitempty"`
Name string `protobuf:"bytes,3,opt,name=name" json:"name,omitempty"`
}
func (m *ProfileMessage) Reset() { *m = ProfileMessage{} }
func (m *ProfileMessage) String() string { return proto.CompactTextString(m) }
func (*ProfileMessage) ProtoMessage() {}
func (*ProfileMessage) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{2} }
func (m *ProfileMessage) GetId() string {
if m != nil {
return m.Id
}
return ""
}
func (m *ProfileMessage) GetProfileType() ProfileMessage_ProfileType {
if m != nil {
return m.ProfileType
}
return ProfileMessage_USER
}
func (m *ProfileMessage) GetName() string {
if m != nil {
return m.Name
}
return ""
}
func init() {
proto.RegisterType((*EmptyMessage)(nil), "helloworld.EmptyMessage")
proto.RegisterType((*IDMessage)(nil), "helloworld.IDMessage")
proto.RegisterType((*ProfileMessage)(nil), "helloworld.ProfileMessage")
proto.RegisterEnum("helloworld.ProfileMessage_ProfileType", ProfileMessage_ProfileType_name, ProfileMessage_ProfileType_value)
}
// 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
// Client API for ProfileService service
type ProfileServiceClient interface {
// List returns all available profiles associated with the account.
List(ctx context.Context, in *EmptyMessage, opts ...grpc.CallOption) (ProfileService_ListClient, error)
// Get
Get(ctx context.Context, in *IDMessage, opts ...grpc.CallOption) (*ProfileMessage, error)
// Update saves profile.
Update(ctx context.Context, in *ProfileMessage, opts ...grpc.CallOption) (*IDMessage, error)
}
type profileServiceClient struct {
cc *grpc.ClientConn
}
func NewProfileServiceClient(cc *grpc.ClientConn) ProfileServiceClient {
return &profileServiceClient{cc}
}
func (c *profileServiceClient) List(ctx context.Context, in *EmptyMessage, opts ...grpc.CallOption) (ProfileService_ListClient, error) {
stream, err := grpc.NewClientStream(ctx, &_ProfileService_serviceDesc.Streams[0], c.cc, "/helloworld.ProfileService/List", opts...)
if err != nil {
return nil, err
}
x := &profileServiceListClient{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 ProfileService_ListClient interface {
Recv() (*ProfileMessage, error)
grpc.ClientStream
}
type profileServiceListClient struct {
grpc.ClientStream
}
func (x *profileServiceListClient) Recv() (*ProfileMessage, error) {
m := new(ProfileMessage)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
func (c *profileServiceClient) Get(ctx context.Context, in *IDMessage, opts ...grpc.CallOption) (*ProfileMessage, error) {
out := new(ProfileMessage)
err := grpc.Invoke(ctx, "/helloworld.ProfileService/Get", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *profileServiceClient) Update(ctx context.Context, in *ProfileMessage, opts ...grpc.CallOption) (*IDMessage, error) {
out := new(IDMessage)
err := grpc.Invoke(ctx, "/helloworld.ProfileService/Update", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// Server API for ProfileService service
type ProfileServiceServer interface {
// List returns all available profiles associated with the account.
List(*EmptyMessage, ProfileService_ListServer) error
// Get
Get(context.Context, *IDMessage) (*ProfileMessage, error)
// Update saves profile.
Update(context.Context, *ProfileMessage) (*IDMessage, error)
}
func RegisterProfileServiceServer(s *grpc.Server, srv ProfileServiceServer) {
s.RegisterService(&_ProfileService_serviceDesc, srv)
}
func _ProfileService_List_Handler(srv interface{}, stream grpc.ServerStream) error {
m := new(EmptyMessage)
if err := stream.RecvMsg(m); err != nil {
return err
}
return srv.(ProfileServiceServer).List(m, &profileServiceListServer{stream})
}
type ProfileService_ListServer interface {
Send(*ProfileMessage) error
grpc.ServerStream
}
type profileServiceListServer struct {
grpc.ServerStream
}
func (x *profileServiceListServer) Send(m *ProfileMessage) error {
return x.ServerStream.SendMsg(m)
}
func _ProfileService_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(IDMessage)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ProfileServiceServer).Get(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/helloworld.ProfileService/Get",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ProfileServiceServer).Get(ctx, req.(*IDMessage))
}
return interceptor(ctx, in, info, handler)
}
func _ProfileService_Update_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ProfileMessage)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ProfileServiceServer).Update(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/helloworld.ProfileService/Update",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ProfileServiceServer).Update(ctx, req.(*ProfileMessage))
}
return interceptor(ctx, in, info, handler)
}
var _ProfileService_serviceDesc = grpc.ServiceDesc{
ServiceName: "helloworld.ProfileService",
HandlerType: (*ProfileServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Get",
Handler: _ProfileService_Get_Handler,
},
{
MethodName: "Update",
Handler: _ProfileService_Update_Handler,
},
},
Streams: []grpc.StreamDesc{
{
StreamName: "List",
Handler: _ProfileService_List_Handler,
ServerStreams: true,
},
},
Metadata: "profile.proto",
}
func init() { proto.RegisterFile("profile.proto", fileDescriptor1) }
var fileDescriptor1 = []byte{
// 314 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x7c, 0x91, 0xdf, 0x4a, 0x3a, 0x41,
0x14, 0xc7, 0x7f, 0xb3, 0xfe, 0xf9, 0xe5, 0x51, 0x37, 0x39, 0x20, 0x2c, 0x5b, 0x17, 0x32, 0x17,
0x21, 0x5d, 0xb8, 0x62, 0x77, 0x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