Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterPersonGuideServer(s grpc.ServiceRegistrar, srv PersonGuideServer)
- type AddressBook
- type Adress
- 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() []*PhoneNumber
- func (*Person) ProtoMessage()
- func (x *Person) ProtoReflect() protoreflect.Message
- func (x *Person) Reset()
- func (x *Person) String() string
- type PersonGuideClient
- type PersonGuideServer
- type PersonGuide_ListPersonsClient
- type PersonGuide_ListPersonsServer
- type PersonGuide_RecordPersonsClient
- type PersonGuide_RecordPersonsServer
- type PersonGuide_RoutePhonesClient
- type PersonGuide_RoutePhonesServer
- type PhoneNumber
- func (*PhoneNumber) Descriptor() ([]byte, []int)deprecated
- func (x *PhoneNumber) GetNumber() string
- func (x *PhoneNumber) GetType() PhoneType
- func (*PhoneNumber) ProtoMessage()
- func (x *PhoneNumber) ProtoReflect() protoreflect.Message
- func (x *PhoneNumber) Reset()
- func (x *PhoneNumber) String() string
- type PhoneType
- type UnimplementedPersonGuideServer
- func (UnimplementedPersonGuideServer) GetPhone(context.Context, *Person) (*PhoneNumber, error)
- func (UnimplementedPersonGuideServer) ListPersons(*Adress, PersonGuide_ListPersonsServer) error
- func (UnimplementedPersonGuideServer) RecordPersons(PersonGuide_RecordPersonsServer) error
- func (UnimplementedPersonGuideServer) RoutePhones(PersonGuide_RoutePhonesServer) error
- type UnsafePersonGuideServer
Constants ¶
const ( PersonGuide_GetPhone_FullMethodName = "/personguide.PersonGuide/GetPhone" PersonGuide_ListPersons_FullMethodName = "/personguide.PersonGuide/ListPersons" PersonGuide_RecordPersons_FullMethodName = "/personguide.PersonGuide/RecordPersons" PersonGuide_RoutePhones_FullMethodName = "/personguide.PersonGuide/RoutePhones" )
Variables ¶
var ( PhoneType_name = map[int32]string{ 0: "MOBILE", 1: "HOME", 2: "WORK", } PhoneType_value = map[string]int32{ "MOBILE": 0, "HOME": 1, "WORK": 2, } )
Enum value maps for PhoneType.
var File_person_guide_proto protoreflect.FileDescriptor
var PersonGuide_ServiceDesc = grpc.ServiceDesc{ ServiceName: "personguide.PersonGuide", HandlerType: (*PersonGuideServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetPhone", Handler: _PersonGuide_GetPhone_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "ListPersons", Handler: _PersonGuide_ListPersons_Handler, ServerStreams: true, }, { StreamName: "RecordPersons", Handler: _PersonGuide_RecordPersons_Handler, ClientStreams: true, }, { StreamName: "RoutePhones", Handler: _PersonGuide_RoutePhones_Handler, ServerStreams: true, ClientStreams: true, }, }, Metadata: "person_guide.proto", }
PersonGuide_ServiceDesc is the grpc.ServiceDesc for PersonGuide service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterPersonGuideServer ¶
func RegisterPersonGuideServer(s grpc.ServiceRegistrar, srv PersonGuideServer)
Types ¶
type AddressBook ¶
type AddressBook struct { People []*Person `protobuf:"bytes,1,rep,name=people,proto3" json:"people,omitempty"` // contains filtered or unexported fields }
Our address book file is just one of these.
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 Adress ¶
type Adress struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // contains filtered or unexported fields }
func (*Adress) Descriptor
deprecated
func (*Adress) ProtoMessage ¶
func (*Adress) ProtoMessage()
func (*Adress) ProtoReflect ¶
func (x *Adress) ProtoReflect() protoreflect.Message
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"` // Unique ID number for this person. Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"` Phones []*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() []*PhoneNumber
func (*Person) ProtoMessage ¶
func (*Person) ProtoMessage()
func (*Person) ProtoReflect ¶
func (x *Person) ProtoReflect() protoreflect.Message
type PersonGuideClient ¶
type PersonGuideClient interface { // A simple RPC. // // Obtains the first phone saved at the given person. // // A feature with an empty name is returned if there's no feature at the given // position. GetPhone(ctx context.Context, in *Person, opts ...grpc.CallOption) (*PhoneNumber, error) // A server-to-client streaming RPC. // // Obtains the Features available within the given Rectangle. Results are // streamed rather than returned at once (e.g. in a response message with a // repeated field), as the rectangle may cover a large area and contain a // huge number of features. ListPersons(ctx context.Context, in *Adress, opts ...grpc.CallOption) (PersonGuide_ListPersonsClient, error) // A client-to-server streaming RPC. // // Accepts a stream of Points on a route being traversed, returning a // RouteSummary when traversal is completed. RecordPersons(ctx context.Context, opts ...grpc.CallOption) (PersonGuide_RecordPersonsClient, error) // A Bidirectional streaming RPC. // // Accepts a stream of RouteNotes sent while a route is being traversed, // while receiving other RouteNotes (e.g. from other users). RoutePhones(ctx context.Context, opts ...grpc.CallOption) (PersonGuide_RoutePhonesClient, error) }
PersonGuideClient is the client API for PersonGuide 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 NewPersonGuideClient ¶
func NewPersonGuideClient(cc grpc.ClientConnInterface) PersonGuideClient
type PersonGuideServer ¶
type PersonGuideServer interface { // A simple RPC. // // Obtains the first phone saved at the given person. // // A feature with an empty name is returned if there's no feature at the given // position. GetPhone(context.Context, *Person) (*PhoneNumber, error) // A server-to-client streaming RPC. // // Obtains the Features available within the given Rectangle. Results are // streamed rather than returned at once (e.g. in a response message with a // repeated field), as the rectangle may cover a large area and contain a // huge number of features. ListPersons(*Adress, PersonGuide_ListPersonsServer) error // A client-to-server streaming RPC. // // Accepts a stream of Points on a route being traversed, returning a // RouteSummary when traversal is completed. RecordPersons(PersonGuide_RecordPersonsServer) error // A Bidirectional streaming RPC. // // Accepts a stream of RouteNotes sent while a route is being traversed, // while receiving other RouteNotes (e.g. from other users). RoutePhones(PersonGuide_RoutePhonesServer) error // contains filtered or unexported methods }
PersonGuideServer is the server API for PersonGuide service. All implementations must embed UnimplementedPersonGuideServer for forward compatibility
type PersonGuide_ListPersonsClient ¶
type PersonGuide_ListPersonsClient interface { Recv() (*Person, error) grpc.ClientStream }
type PersonGuide_ListPersonsServer ¶
type PersonGuide_ListPersonsServer interface { Send(*Person) error grpc.ServerStream }
type PersonGuide_RecordPersonsClient ¶
type PersonGuide_RecordPersonsClient interface { Send(*Person) error CloseAndRecv() (*AddressBook, error) grpc.ClientStream }
type PersonGuide_RecordPersonsServer ¶
type PersonGuide_RecordPersonsServer interface { SendAndClose(*AddressBook) error Recv() (*Person, error) grpc.ServerStream }
type PersonGuide_RoutePhonesClient ¶
type PersonGuide_RoutePhonesClient interface { Send(*Person) error Recv() (*PhoneNumber, error) grpc.ClientStream }
type PersonGuide_RoutePhonesServer ¶
type PersonGuide_RoutePhonesServer interface { Send(*PhoneNumber) error Recv() (*Person, error) grpc.ServerStream }
type PhoneNumber ¶
type PhoneNumber struct { Number string `protobuf:"bytes,1,opt,name=number,proto3" json:"number,omitempty"` Type PhoneType `protobuf:"varint,2,opt,name=type,proto3,enum=personguide.PhoneType" json:"type,omitempty"` // contains filtered or unexported fields }
func (*PhoneNumber) Descriptor
deprecated
func (*PhoneNumber) Descriptor() ([]byte, []int)
Deprecated: Use PhoneNumber.ProtoReflect.Descriptor instead.
func (*PhoneNumber) GetNumber ¶
func (x *PhoneNumber) GetNumber() string
func (*PhoneNumber) GetType ¶
func (x *PhoneNumber) GetType() PhoneType
func (*PhoneNumber) ProtoMessage ¶
func (*PhoneNumber) ProtoMessage()
func (*PhoneNumber) ProtoReflect ¶
func (x *PhoneNumber) ProtoReflect() protoreflect.Message
func (*PhoneNumber) Reset ¶
func (x *PhoneNumber) Reset()
func (*PhoneNumber) String ¶
func (x *PhoneNumber) String() string
type PhoneType ¶
type PhoneType int32
func (PhoneType) Descriptor ¶
func (PhoneType) Descriptor() protoreflect.EnumDescriptor
func (PhoneType) EnumDescriptor
deprecated
func (PhoneType) Number ¶
func (x PhoneType) Number() protoreflect.EnumNumber
func (PhoneType) Type ¶
func (PhoneType) Type() protoreflect.EnumType
type UnimplementedPersonGuideServer ¶
type UnimplementedPersonGuideServer struct { }
UnimplementedPersonGuideServer must be embedded to have forward compatible implementations.
func (UnimplementedPersonGuideServer) GetPhone ¶
func (UnimplementedPersonGuideServer) GetPhone(context.Context, *Person) (*PhoneNumber, error)
func (UnimplementedPersonGuideServer) ListPersons ¶
func (UnimplementedPersonGuideServer) ListPersons(*Adress, PersonGuide_ListPersonsServer) error
func (UnimplementedPersonGuideServer) RecordPersons ¶
func (UnimplementedPersonGuideServer) RecordPersons(PersonGuide_RecordPersonsServer) error
func (UnimplementedPersonGuideServer) RoutePhones ¶
func (UnimplementedPersonGuideServer) RoutePhones(PersonGuide_RoutePhonesServer) error
type UnsafePersonGuideServer ¶
type UnsafePersonGuideServer interface {
// contains filtered or unexported methods
}
UnsafePersonGuideServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to PersonGuideServer will result in compilation errors.