Documentation ¶
Index ¶
- Variables
- func RegisterContactsServer(s grpc.ServiceRegistrar, srv ContactsServer)
- type Contact
- func (*Contact) Descriptor() ([]byte, []int)deprecated
- func (x *Contact) GetForename() string
- func (x *Contact) GetId() string
- func (x *Contact) GetPhoneNumber() string
- func (x *Contact) GetSurname() string
- func (*Contact) ProtoMessage()
- func (x *Contact) ProtoReflect() protoreflect.Message
- func (x *Contact) Reset()
- func (x *Contact) String() string
- type ContactsClient
- type ContactsServer
- type ListContactsRequest
- func (*ListContactsRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ListContactsRequest) GetPageSize() int32
- func (x *ListContactsRequest) GetPageToken() string
- func (x *ListContactsRequest) GetQuery() *ListContactsRequest_Filters
- func (x *ListContactsRequest) GetSkip() int32
- func (*ListContactsRequest) ProtoMessage()
- func (x *ListContactsRequest) ProtoReflect() protoreflect.Message
- func (x *ListContactsRequest) Reset()
- func (x *ListContactsRequest) String() string
- type ListContactsRequest_Filters
- func (*ListContactsRequest_Filters) Descriptor() ([]byte, []int)deprecated
- func (x *ListContactsRequest_Filters) GetForename() string
- func (x *ListContactsRequest_Filters) GetPhoneNumber() string
- func (*ListContactsRequest_Filters) ProtoMessage()
- func (x *ListContactsRequest_Filters) ProtoReflect() protoreflect.Message
- func (x *ListContactsRequest_Filters) Reset()
- func (x *ListContactsRequest_Filters) String() string
- type ListContactsResponse
- func (*ListContactsResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ListContactsResponse) GetContacts() []*Contact
- func (x *ListContactsResponse) GetNextPageToken() string
- func (x *ListContactsResponse) GetTotal() int32
- func (*ListContactsResponse) ProtoMessage()
- func (x *ListContactsResponse) ProtoReflect() protoreflect.Message
- func (x *ListContactsResponse) Reset()
- func (x *ListContactsResponse) String() string
- type UnimplementedContactsServer
- type UnsafeContactsServer
Constants ¶
This section is empty.
Variables ¶
var Contacts_ServiceDesc = grpc.ServiceDesc{ ServiceName: "Contacts", HandlerType: (*ContactsServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "ListContacts", Handler: _Contacts_ListContacts_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "contacts.proto", }
Contacts_ServiceDesc is the grpc.ServiceDesc for Contacts service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_contacts_proto protoreflect.FileDescriptor
Functions ¶
func RegisterContactsServer ¶
func RegisterContactsServer(s grpc.ServiceRegistrar, srv ContactsServer)
Types ¶
type Contact ¶
type Contact struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Forename string `protobuf:"bytes,2,opt,name=forename,proto3" json:"forename,omitempty"` Surname string `protobuf:"bytes,3,opt,name=surname,proto3" json:"surname,omitempty"` PhoneNumber string `protobuf:"bytes,4,opt,name=phone_number,json=phoneNumber,proto3" json:"phone_number,omitempty"` // contains filtered or unexported fields }
func (*Contact) Descriptor
deprecated
func (*Contact) GetForename ¶
func (*Contact) GetPhoneNumber ¶
func (*Contact) GetSurname ¶
func (*Contact) ProtoMessage ¶
func (*Contact) ProtoMessage()
func (*Contact) ProtoReflect ¶
func (x *Contact) ProtoReflect() protoreflect.Message
type ContactsClient ¶
type ContactsClient interface { // Get a list of contacts. ListContacts(ctx context.Context, in *ListContactsRequest, opts ...grpc.CallOption) (*ListContactsResponse, error) }
ContactsClient is the client API for Contacts 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 NewContactsClient ¶
func NewContactsClient(cc grpc.ClientConnInterface) ContactsClient
type ContactsServer ¶
type ContactsServer interface { // Get a list of contacts. ListContacts(context.Context, *ListContactsRequest) (*ListContactsResponse, error) }
ContactsServer is the server API for Contacts service. All implementations should embed UnimplementedContactsServer for forward compatibility
type ListContactsRequest ¶
type ListContactsRequest struct { // The query, this MUST NOT be set when using a page // token. Query *ListContactsRequest_Filters `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"` // How many results to return in one request, this // must be a minimum of 0 and a sane maximum, in this // case the server will return invalid arguement if // the page size is over 30 just to simulate it easier. PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` // How many results to skip, this can be sent on the // first page request or when obtaining "next page". Skip int32 `protobuf:"varint,3,opt,name=skip,proto3" json:"skip,omitempty"` // The page token, if not set the first page of results // is returned. PageToken string `protobuf:"bytes,4,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` // contains filtered or unexported fields }
func (*ListContactsRequest) Descriptor
deprecated
func (*ListContactsRequest) Descriptor() ([]byte, []int)
Deprecated: Use ListContactsRequest.ProtoReflect.Descriptor instead.
func (*ListContactsRequest) GetPageSize ¶
func (x *ListContactsRequest) GetPageSize() int32
func (*ListContactsRequest) GetPageToken ¶
func (x *ListContactsRequest) GetPageToken() string
func (*ListContactsRequest) GetQuery ¶
func (x *ListContactsRequest) GetQuery() *ListContactsRequest_Filters
func (*ListContactsRequest) GetSkip ¶
func (x *ListContactsRequest) GetSkip() int32
func (*ListContactsRequest) ProtoMessage ¶
func (*ListContactsRequest) ProtoMessage()
func (*ListContactsRequest) ProtoReflect ¶
func (x *ListContactsRequest) ProtoReflect() protoreflect.Message
func (*ListContactsRequest) Reset ¶
func (x *ListContactsRequest) Reset()
func (*ListContactsRequest) String ¶
func (x *ListContactsRequest) String() string
type ListContactsRequest_Filters ¶
type ListContactsRequest_Filters struct { // Filter on a partial forname. Forename string `protobuf:"bytes,1,opt,name=forename,proto3" json:"forename,omitempty"` // Filter on a partial phone number. PhoneNumber string `protobuf:"bytes,2,opt,name=phone_number,json=phoneNumber,proto3" json:"phone_number,omitempty"` // contains filtered or unexported fields }
Filters message, we use a separate message to define the filters, this means we can use this message to encode the query for use on subsequent results.
func (*ListContactsRequest_Filters) Descriptor
deprecated
func (*ListContactsRequest_Filters) Descriptor() ([]byte, []int)
Deprecated: Use ListContactsRequest_Filters.ProtoReflect.Descriptor instead.
func (*ListContactsRequest_Filters) GetForename ¶
func (x *ListContactsRequest_Filters) GetForename() string
func (*ListContactsRequest_Filters) GetPhoneNumber ¶
func (x *ListContactsRequest_Filters) GetPhoneNumber() string
func (*ListContactsRequest_Filters) ProtoMessage ¶
func (*ListContactsRequest_Filters) ProtoMessage()
func (*ListContactsRequest_Filters) ProtoReflect ¶
func (x *ListContactsRequest_Filters) ProtoReflect() protoreflect.Message
func (*ListContactsRequest_Filters) Reset ¶
func (x *ListContactsRequest_Filters) Reset()
func (*ListContactsRequest_Filters) String ¶
func (x *ListContactsRequest_Filters) String() string
type ListContactsResponse ¶
type ListContactsResponse struct { // A list of contacts, ranging between 0 and // `page_size` in length. Contacts []*Contact `protobuf:"bytes,1,rep,name=contacts,proto3" json:"contacts,omitempty"` // The total results found in the query. Total int32 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` // If set, means there is more results. Use this page token // in the next call to `ListContacts` to load more results. NextPageToken string `protobuf:"bytes,3,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` // contains filtered or unexported fields }
func (*ListContactsResponse) Descriptor
deprecated
func (*ListContactsResponse) Descriptor() ([]byte, []int)
Deprecated: Use ListContactsResponse.ProtoReflect.Descriptor instead.
func (*ListContactsResponse) GetContacts ¶
func (x *ListContactsResponse) GetContacts() []*Contact
func (*ListContactsResponse) GetNextPageToken ¶
func (x *ListContactsResponse) GetNextPageToken() string
func (*ListContactsResponse) GetTotal ¶
func (x *ListContactsResponse) GetTotal() int32
func (*ListContactsResponse) ProtoMessage ¶
func (*ListContactsResponse) ProtoMessage()
func (*ListContactsResponse) ProtoReflect ¶
func (x *ListContactsResponse) ProtoReflect() protoreflect.Message
func (*ListContactsResponse) Reset ¶
func (x *ListContactsResponse) Reset()
func (*ListContactsResponse) String ¶
func (x *ListContactsResponse) String() string
type UnimplementedContactsServer ¶
type UnimplementedContactsServer struct { }
UnimplementedContactsServer should be embedded to have forward compatible implementations.
func (UnimplementedContactsServer) ListContacts ¶
func (UnimplementedContactsServer) ListContacts(context.Context, *ListContactsRequest) (*ListContactsResponse, error)
type UnsafeContactsServer ¶
type UnsafeContactsServer interface {
// contains filtered or unexported methods
}
UnsafeContactsServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ContactsServer will result in compilation errors.