Documentation ¶
Index ¶
- Variables
- func RegisterCustomerServer(s grpc.ServiceRegistrar, srv CustomerServer)
- type CustomerClient
- type CustomerFilter
- type CustomerRequest
- func (*CustomerRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CustomerRequest) GetAddresses() []*CustomerRequest_Address
- func (x *CustomerRequest) GetEmail() string
- func (x *CustomerRequest) GetId() int32
- func (x *CustomerRequest) GetName() string
- func (x *CustomerRequest) GetPhone() string
- func (*CustomerRequest) ProtoMessage()
- func (x *CustomerRequest) ProtoReflect() protoreflect.Message
- func (x *CustomerRequest) Reset()
- func (x *CustomerRequest) String() string
- type CustomerRequest_Address
- func (*CustomerRequest_Address) Descriptor() ([]byte, []int)deprecated
- func (x *CustomerRequest_Address) GetCity() string
- func (x *CustomerRequest_Address) GetIsShippingAddress() bool
- func (x *CustomerRequest_Address) GetState() string
- func (x *CustomerRequest_Address) GetStreet() string
- func (x *CustomerRequest_Address) GetZip() string
- func (*CustomerRequest_Address) ProtoMessage()
- func (x *CustomerRequest_Address) ProtoReflect() protoreflect.Message
- func (x *CustomerRequest_Address) Reset()
- func (x *CustomerRequest_Address) String() string
- type CustomerResponse
- func (*CustomerResponse) Descriptor() ([]byte, []int)deprecated
- func (x *CustomerResponse) GetId() int32
- func (x *CustomerResponse) GetSuccess() bool
- func (*CustomerResponse) ProtoMessage()
- func (x *CustomerResponse) ProtoReflect() protoreflect.Message
- func (x *CustomerResponse) Reset()
- func (x *CustomerResponse) String() string
- type CustomerServer
- type Customer_GetCustomersClient
- type Customer_GetCustomersServer
- type UnimplementedCustomerServer
- type UnsafeCustomerServer
Constants ¶
This section is empty.
Variables ¶
var Customer_ServiceDesc = grpc.ServiceDesc{ ServiceName: "customer.Customer", HandlerType: (*CustomerServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "CreateCustomer", Handler: _Customer_CreateCustomer_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "GetCustomers", Handler: _Customer_GetCustomers_Handler, ServerStreams: true, }, }, Metadata: "customer.proto", }
Customer_ServiceDesc is the grpc.ServiceDesc for Customer service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_customer_proto protoreflect.FileDescriptor
Functions ¶
func RegisterCustomerServer ¶
func RegisterCustomerServer(s grpc.ServiceRegistrar, srv CustomerServer)
Types ¶
type CustomerClient ¶
type CustomerClient interface { // Get all Customers with filter - A server-to-client streaming RPC. GetCustomers(ctx context.Context, in *CustomerFilter, opts ...grpc.CallOption) (Customer_GetCustomersClient, error) // Create a new Customer - A simple RPC CreateCustomer(ctx context.Context, in *CustomerRequest, opts ...grpc.CallOption) (*CustomerResponse, error) }
CustomerClient is the client API for Customer 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 NewCustomerClient ¶
func NewCustomerClient(cc grpc.ClientConnInterface) CustomerClient
type CustomerFilter ¶
type CustomerFilter struct { Keyword string `protobuf:"bytes,1,opt,name=keyword,proto3" json:"keyword,omitempty"` // contains filtered or unexported fields }
func (*CustomerFilter) Descriptor
deprecated
func (*CustomerFilter) Descriptor() ([]byte, []int)
Deprecated: Use CustomerFilter.ProtoReflect.Descriptor instead.
func (*CustomerFilter) GetKeyword ¶
func (x *CustomerFilter) GetKeyword() string
func (*CustomerFilter) ProtoMessage ¶
func (*CustomerFilter) ProtoMessage()
func (*CustomerFilter) ProtoReflect ¶
func (x *CustomerFilter) ProtoReflect() protoreflect.Message
func (*CustomerFilter) Reset ¶
func (x *CustomerFilter) Reset()
func (*CustomerFilter) String ¶
func (x *CustomerFilter) String() string
type CustomerRequest ¶
type CustomerRequest struct { Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // Unique ID number for a Customer. Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"` Phone string `protobuf:"bytes,4,opt,name=phone,proto3" json:"phone,omitempty"` Addresses []*CustomerRequest_Address `protobuf:"bytes,5,rep,name=addresses,proto3" json:"addresses,omitempty"` // contains filtered or unexported fields }
Request message for creating a new customer
func (*CustomerRequest) Descriptor
deprecated
func (*CustomerRequest) Descriptor() ([]byte, []int)
Deprecated: Use CustomerRequest.ProtoReflect.Descriptor instead.
func (*CustomerRequest) GetAddresses ¶
func (x *CustomerRequest) GetAddresses() []*CustomerRequest_Address
func (*CustomerRequest) GetEmail ¶
func (x *CustomerRequest) GetEmail() string
func (*CustomerRequest) GetId ¶
func (x *CustomerRequest) GetId() int32
func (*CustomerRequest) GetName ¶
func (x *CustomerRequest) GetName() string
func (*CustomerRequest) GetPhone ¶
func (x *CustomerRequest) GetPhone() string
func (*CustomerRequest) ProtoMessage ¶
func (*CustomerRequest) ProtoMessage()
func (*CustomerRequest) ProtoReflect ¶
func (x *CustomerRequest) ProtoReflect() protoreflect.Message
func (*CustomerRequest) Reset ¶
func (x *CustomerRequest) Reset()
func (*CustomerRequest) String ¶
func (x *CustomerRequest) String() string
type CustomerRequest_Address ¶
type CustomerRequest_Address struct { Street string `protobuf:"bytes,1,opt,name=street,proto3" json:"street,omitempty"` City string `protobuf:"bytes,2,opt,name=city,proto3" json:"city,omitempty"` State string `protobuf:"bytes,3,opt,name=state,proto3" json:"state,omitempty"` Zip string `protobuf:"bytes,4,opt,name=zip,proto3" json:"zip,omitempty"` IsShippingAddress bool `protobuf:"varint,5,opt,name=isShippingAddress,proto3" json:"isShippingAddress,omitempty"` // contains filtered or unexported fields }
func (*CustomerRequest_Address) Descriptor
deprecated
func (*CustomerRequest_Address) Descriptor() ([]byte, []int)
Deprecated: Use CustomerRequest_Address.ProtoReflect.Descriptor instead.
func (*CustomerRequest_Address) GetCity ¶
func (x *CustomerRequest_Address) GetCity() string
func (*CustomerRequest_Address) GetIsShippingAddress ¶
func (x *CustomerRequest_Address) GetIsShippingAddress() bool
func (*CustomerRequest_Address) GetState ¶
func (x *CustomerRequest_Address) GetState() string
func (*CustomerRequest_Address) GetStreet ¶
func (x *CustomerRequest_Address) GetStreet() string
func (*CustomerRequest_Address) GetZip ¶
func (x *CustomerRequest_Address) GetZip() string
func (*CustomerRequest_Address) ProtoMessage ¶
func (*CustomerRequest_Address) ProtoMessage()
func (*CustomerRequest_Address) ProtoReflect ¶
func (x *CustomerRequest_Address) ProtoReflect() protoreflect.Message
func (*CustomerRequest_Address) Reset ¶
func (x *CustomerRequest_Address) Reset()
func (*CustomerRequest_Address) String ¶
func (x *CustomerRequest_Address) String() string
type CustomerResponse ¶
type CustomerResponse struct { Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Success bool `protobuf:"varint,2,opt,name=success,proto3" json:"success,omitempty"` // contains filtered or unexported fields }
func (*CustomerResponse) Descriptor
deprecated
func (*CustomerResponse) Descriptor() ([]byte, []int)
Deprecated: Use CustomerResponse.ProtoReflect.Descriptor instead.
func (*CustomerResponse) GetId ¶
func (x *CustomerResponse) GetId() int32
func (*CustomerResponse) GetSuccess ¶
func (x *CustomerResponse) GetSuccess() bool
func (*CustomerResponse) ProtoMessage ¶
func (*CustomerResponse) ProtoMessage()
func (*CustomerResponse) ProtoReflect ¶
func (x *CustomerResponse) ProtoReflect() protoreflect.Message
func (*CustomerResponse) Reset ¶
func (x *CustomerResponse) Reset()
func (*CustomerResponse) String ¶
func (x *CustomerResponse) String() string
type CustomerServer ¶
type CustomerServer interface { // Get all Customers with filter - A server-to-client streaming RPC. GetCustomers(*CustomerFilter, Customer_GetCustomersServer) error // Create a new Customer - A simple RPC CreateCustomer(context.Context, *CustomerRequest) (*CustomerResponse, error) // contains filtered or unexported methods }
CustomerServer is the server API for Customer service. All implementations must embed UnimplementedCustomerServer for forward compatibility
type Customer_GetCustomersClient ¶
type Customer_GetCustomersClient interface { Recv() (*CustomerRequest, error) grpc.ClientStream }
type Customer_GetCustomersServer ¶
type Customer_GetCustomersServer interface { Send(*CustomerRequest) error grpc.ServerStream }
type UnimplementedCustomerServer ¶
type UnimplementedCustomerServer struct { }
UnimplementedCustomerServer must be embedded to have forward compatible implementations.
func (UnimplementedCustomerServer) CreateCustomer ¶
func (UnimplementedCustomerServer) CreateCustomer(context.Context, *CustomerRequest) (*CustomerResponse, error)
func (UnimplementedCustomerServer) GetCustomers ¶
func (UnimplementedCustomerServer) GetCustomers(*CustomerFilter, Customer_GetCustomersServer) error
type UnsafeCustomerServer ¶
type UnsafeCustomerServer interface {
// contains filtered or unexported methods
}
UnsafeCustomerServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to CustomerServer will result in compilation errors.