personguide

package
v0.0.0-...-2a67fa2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 20, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
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

View Source
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.

View Source
var File_person_guide_proto protoreflect.FileDescriptor
View Source
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) Descriptor() ([]byte, []int)

Deprecated: Use Adress.ProtoReflect.Descriptor instead.

func (*Adress) GetName

func (x *Adress) GetName() string

func (*Adress) ProtoMessage

func (*Adress) ProtoMessage()

func (*Adress) ProtoReflect

func (x *Adress) ProtoReflect() protoreflect.Message

func (*Adress) Reset

func (x *Adress) Reset()

func (*Adress) String

func (x *Adress) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use Person.ProtoReflect.Descriptor instead.

func (*Person) GetEmail

func (x *Person) GetEmail() string

func (*Person) GetId

func (x *Person) GetId() int32

func (*Person) GetLastUpdated

func (x *Person) GetLastUpdated() *timestamppb.Timestamp

func (*Person) GetName

func (x *Person) GetName() string

func (*Person) GetPhones

func (x *Person) GetPhones() []*PhoneNumber

func (*Person) ProtoMessage

func (*Person) ProtoMessage()

func (*Person) ProtoReflect

func (x *Person) ProtoReflect() protoreflect.Message

func (*Person) Reset

func (x *Person) Reset()

func (*Person) String

func (x *Person) String() string

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.

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
const (
	PhoneType_MOBILE PhoneType = 0
	PhoneType_HOME   PhoneType = 1
	PhoneType_WORK   PhoneType = 2
)

func (PhoneType) Descriptor

func (PhoneType) Descriptor() protoreflect.EnumDescriptor

func (PhoneType) Enum

func (x PhoneType) Enum() *PhoneType

func (PhoneType) EnumDescriptor deprecated

func (PhoneType) EnumDescriptor() ([]byte, []int)

Deprecated: Use PhoneType.Descriptor instead.

func (PhoneType) Number

func (x PhoneType) Number() protoreflect.EnumNumber

func (PhoneType) String

func (x PhoneType) String() string

func (PhoneType) Type

type UnimplementedPersonGuideServer

type UnimplementedPersonGuideServer struct {
}

UnimplementedPersonGuideServer must be embedded to have forward compatible implementations.

func (UnimplementedPersonGuideServer) GetPhone

func (UnimplementedPersonGuideServer) ListPersons

func (UnimplementedPersonGuideServer) RecordPersons

func (UnimplementedPersonGuideServer) RoutePhones

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL