Documentation ¶
Index ¶
- Variables
- func RegisterGetPhoneNumberServer(s grpc.ServiceRegistrar, srv GetPhoneNumberServer)
- type AddressBook
- type GetPhoneNumberClient
- type GetPhoneNumberServer
- type Person
- func (*Person) Descriptor() ([]byte, []int)deprecated
- func (x *Person) GetEmail() string
- func (x *Person) GetId() int32
- func (x *Person) GetLastUpdated() *timestamppb.Timestamp
- func (x *Person) GetName() string
- func (x *Person) GetPhones() []*Person_PhoneNumber
- func (*Person) ProtoMessage()
- func (x *Person) ProtoReflect() protoreflect.Message
- func (x *Person) Reset()
- func (x *Person) String() string
- type Person_PhoneNumber
- func (*Person_PhoneNumber) Descriptor() ([]byte, []int)deprecated
- func (x *Person_PhoneNumber) GetNumber() string
- func (x *Person_PhoneNumber) GetType() Person_PhoneType
- func (*Person_PhoneNumber) ProtoMessage()
- func (x *Person_PhoneNumber) ProtoReflect() protoreflect.Message
- func (x *Person_PhoneNumber) Reset()
- func (x *Person_PhoneNumber) String() string
- type Person_PhoneType
- func (Person_PhoneType) Descriptor() protoreflect.EnumDescriptor
- func (x Person_PhoneType) Enum() *Person_PhoneType
- func (Person_PhoneType) EnumDescriptor() ([]byte, []int)deprecated
- func (x Person_PhoneType) Number() protoreflect.EnumNumber
- func (x Person_PhoneType) String() string
- func (Person_PhoneType) Type() protoreflect.EnumType
- type Pid
- type UnimplementedGetPhoneNumberServer
- type UnsafeGetPhoneNumberServer
Constants ¶
This section is empty.
Variables ¶
var ( Person_PhoneType_name = map[int32]string{ 0: "MOBILE", 1: "HOME", 2: "WORK", } Person_PhoneType_value = map[string]int32{ "MOBILE": 0, "HOME": 1, "WORK": 2, } )
Enum value maps for Person_PhoneType.
var File_messages_proto protoreflect.FileDescriptor
Functions ¶
func RegisterGetPhoneNumberServer ¶
func RegisterGetPhoneNumberServer(s grpc.ServiceRegistrar, srv GetPhoneNumberServer)
Types ¶
type AddressBook ¶
type AddressBook struct { People []*Person `protobuf:"bytes,1,rep,name=people,proto3" json:"people,omitempty"` // contains filtered or unexported fields }
func (*AddressBook) Descriptor
deprecated
func (*AddressBook) Descriptor() ([]byte, []int)
Deprecated: Use AddressBook.ProtoReflect.Descriptor instead.
func (*AddressBook) GetPeople ¶
func (x *AddressBook) GetPeople() []*Person
func (*AddressBook) ProtoMessage ¶
func (*AddressBook) ProtoMessage()
func (*AddressBook) ProtoReflect ¶
func (x *AddressBook) ProtoReflect() protoreflect.Message
func (*AddressBook) Reset ¶
func (x *AddressBook) Reset()
func (*AddressBook) String ¶
func (x *AddressBook) String() string
type GetPhoneNumberClient ¶
type GetPhoneNumberClient interface {
GetNum(ctx context.Context, in *Pid, opts ...grpc.CallOption) (*Person, error)
}
GetPhoneNumberClient is the client API for GetPhoneNumber service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewGetPhoneNumberClient ¶
func NewGetPhoneNumberClient(cc grpc.ClientConnInterface) GetPhoneNumberClient
type GetPhoneNumberServer ¶
type GetPhoneNumberServer interface { GetNum(context.Context, *Pid) (*Person, error) // contains filtered or unexported methods }
GetPhoneNumberServer is the server API for GetPhoneNumber service. All implementations must embed UnimplementedGetPhoneNumberServer for forward compatibility
type Person ¶
type Person struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Id int32 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"` Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"` Phones []*Person_PhoneNumber `protobuf:"bytes,4,rep,name=phones,proto3" json:"phones,omitempty"` LastUpdated *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=last_updated,json=lastUpdated,proto3" json:"last_updated,omitempty"` // contains filtered or unexported fields }
func (*Person) Descriptor
deprecated
func (*Person) GetLastUpdated ¶
func (x *Person) GetLastUpdated() *timestamppb.Timestamp
func (*Person) GetPhones ¶
func (x *Person) GetPhones() []*Person_PhoneNumber
func (*Person) ProtoMessage ¶
func (*Person) ProtoMessage()
func (*Person) ProtoReflect ¶
func (x *Person) ProtoReflect() protoreflect.Message
type Person_PhoneNumber ¶
type Person_PhoneNumber struct { Number string `protobuf:"bytes,1,opt,name=number,proto3" json:"number,omitempty"` Type Person_PhoneType `protobuf:"varint,2,opt,name=type,proto3,enum=messages.Person_PhoneType" json:"type,omitempty"` // contains filtered or unexported fields }
func (*Person_PhoneNumber) Descriptor
deprecated
func (*Person_PhoneNumber) Descriptor() ([]byte, []int)
Deprecated: Use Person_PhoneNumber.ProtoReflect.Descriptor instead.
func (*Person_PhoneNumber) GetNumber ¶
func (x *Person_PhoneNumber) GetNumber() string
func (*Person_PhoneNumber) GetType ¶
func (x *Person_PhoneNumber) GetType() Person_PhoneType
func (*Person_PhoneNumber) ProtoMessage ¶
func (*Person_PhoneNumber) ProtoMessage()
func (*Person_PhoneNumber) ProtoReflect ¶
func (x *Person_PhoneNumber) ProtoReflect() protoreflect.Message
func (*Person_PhoneNumber) Reset ¶
func (x *Person_PhoneNumber) Reset()
func (*Person_PhoneNumber) String ¶
func (x *Person_PhoneNumber) String() string
type Person_PhoneType ¶
type Person_PhoneType int32
const ( Person_MOBILE Person_PhoneType = 0 Person_HOME Person_PhoneType = 1 Person_WORK Person_PhoneType = 2 )
func (Person_PhoneType) Descriptor ¶
func (Person_PhoneType) Descriptor() protoreflect.EnumDescriptor
func (Person_PhoneType) Enum ¶
func (x Person_PhoneType) Enum() *Person_PhoneType
func (Person_PhoneType) EnumDescriptor
deprecated
func (Person_PhoneType) EnumDescriptor() ([]byte, []int)
Deprecated: Use Person_PhoneType.Descriptor instead.
func (Person_PhoneType) Number ¶
func (x Person_PhoneType) Number() protoreflect.EnumNumber
func (Person_PhoneType) String ¶
func (x Person_PhoneType) String() string
func (Person_PhoneType) Type ¶
func (Person_PhoneType) Type() protoreflect.EnumType
type Pid ¶
type Pid struct { Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*Pid) Descriptor
deprecated
func (*Pid) ProtoMessage ¶
func (*Pid) ProtoMessage()
func (*Pid) ProtoReflect ¶
func (x *Pid) ProtoReflect() protoreflect.Message
type UnimplementedGetPhoneNumberServer ¶
type UnimplementedGetPhoneNumberServer struct { }
UnimplementedGetPhoneNumberServer must be embedded to have forward compatible implementations.
type UnsafeGetPhoneNumberServer ¶
type UnsafeGetPhoneNumberServer interface {
// contains filtered or unexported methods
}
UnsafeGetPhoneNumberServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to GetPhoneNumberServer will result in compilation errors.