Documentation ¶
Index ¶
- Variables
- func RegisterBrokerServer(s grpc.ServiceRegistrar, srv BrokerServer)
- type BrokerClient
- type BrokerServer
- type Broker_ConsumeClient
- type Broker_ConsumeServer
- type Broker_PublishClient
- type Broker_PublishServer
- type ConsumeRequest
- type M
- type Payload
- func (*Payload) Descriptor() ([]byte, []int)deprecated
- func (x *Payload) GetAverageStars() float32
- func (x *Payload) GetName() string
- func (x *Payload) GetReviewCount() int64
- func (x *Payload) GetUrl() string
- func (x *Payload) GetUserId() string
- func (*Payload) ProtoMessage()
- func (x *Payload) ProtoReflect() protoreflect.Message
- func (x *Payload) Reset()
- func (x *Payload) String() string
- type Response
- type UnimplementedBrokerServer
- type UnsafeBrokerServer
Constants ¶
This section is empty.
Variables ¶
var Broker_ServiceDesc = grpc.ServiceDesc{ ServiceName: "types.Broker", HandlerType: (*BrokerServer)(nil), Methods: []grpc.MethodDesc{}, Streams: []grpc.StreamDesc{ { StreamName: "Publish", Handler: _Broker_Publish_Handler, ClientStreams: true, }, { StreamName: "Consume", Handler: _Broker_Consume_Handler, ServerStreams: true, }, }, Metadata: "payload.proto", }
Broker_ServiceDesc is the grpc.ServiceDesc for Broker service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_payload_proto protoreflect.FileDescriptor
Functions ¶
func RegisterBrokerServer ¶
func RegisterBrokerServer(s grpc.ServiceRegistrar, srv BrokerServer)
Types ¶
type BrokerClient ¶
type BrokerClient interface { // Publish sends a stream of payloads to the server for in-memory storage Publish(ctx context.Context, opts ...grpc.CallOption) (Broker_PublishClient, error) // Consume consumes a specified number of objects from the server Consume(ctx context.Context, in *ConsumeRequest, opts ...grpc.CallOption) (Broker_ConsumeClient, error) }
BrokerClient is the client API for Broker 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 NewBrokerClient ¶
func NewBrokerClient(cc grpc.ClientConnInterface) BrokerClient
type BrokerServer ¶
type BrokerServer interface { // Publish sends a stream of payloads to the server for in-memory storage Publish(Broker_PublishServer) error // Consume consumes a specified number of objects from the server Consume(*ConsumeRequest, Broker_ConsumeServer) error // contains filtered or unexported methods }
BrokerServer is the server API for Broker service. All implementations must embed UnimplementedBrokerServer for forward compatibility
type Broker_ConsumeClient ¶
type Broker_ConsumeClient interface { Recv() (*Payload, error) grpc.ClientStream }
type Broker_ConsumeServer ¶
type Broker_ConsumeServer interface { Send(*Payload) error grpc.ServerStream }
type Broker_PublishClient ¶
type Broker_PublishServer ¶
type ConsumeRequest ¶
type ConsumeRequest struct { Count int64 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` // contains filtered or unexported fields }
ConsumeRequest message is used for consuming specified number of objects from the server
func (*ConsumeRequest) Descriptor
deprecated
func (*ConsumeRequest) Descriptor() ([]byte, []int)
Deprecated: Use ConsumeRequest.ProtoReflect.Descriptor instead.
func (*ConsumeRequest) GetCount ¶
func (x *ConsumeRequest) GetCount() int64
func (*ConsumeRequest) ProtoMessage ¶
func (*ConsumeRequest) ProtoMessage()
func (*ConsumeRequest) ProtoReflect ¶
func (x *ConsumeRequest) ProtoReflect() protoreflect.Message
func (*ConsumeRequest) Reset ¶
func (x *ConsumeRequest) Reset()
func (*ConsumeRequest) String ¶
func (x *ConsumeRequest) String() string
type Payload ¶
type Payload struct { UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty" bson:"user_id,omitempty"` // @gotags: bson:"user_id,omitempty" Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty" bson:"name,omitempty"` // @gotags: bson:"name,omitempty" Url string `protobuf:"bytes,3,opt,name=url,proto3" json:"url,omitempty" bson:"url,omitempty"` // @gotags: bson:"url,omitempty" AverageStars float32 `` // @gotags: bson:"average_stars,omitempty" /* 130-byte string literal not displayed */ ReviewCount int64 `protobuf:"varint,5,opt,name=review_count,json=reviewCount,proto3" json:"review_count,omitempty" bson:"review_count,omitempty"` // @gotags: bson:"review_count,omitempty" // contains filtered or unexported fields }
Payload to be transferred over GRPC
func (*Payload) Descriptor
deprecated
func (*Payload) GetAverageStars ¶
func (*Payload) GetReviewCount ¶
func (*Payload) ProtoMessage ¶
func (*Payload) ProtoMessage()
func (*Payload) ProtoReflect ¶
func (x *Payload) ProtoReflect() protoreflect.Message
type Response ¶
type Response struct { Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` // contains filtered or unexported fields }
Response message consisting array of errors
func (*Response) Descriptor
deprecated
func (*Response) GetSuccess ¶
func (*Response) ProtoMessage ¶
func (*Response) ProtoMessage()
func (*Response) ProtoReflect ¶
func (x *Response) ProtoReflect() protoreflect.Message
type UnimplementedBrokerServer ¶
type UnimplementedBrokerServer struct { }
UnimplementedBrokerServer must be embedded to have forward compatible implementations.
func (UnimplementedBrokerServer) Consume ¶
func (UnimplementedBrokerServer) Consume(*ConsumeRequest, Broker_ConsumeServer) error
func (UnimplementedBrokerServer) Publish ¶
func (UnimplementedBrokerServer) Publish(Broker_PublishServer) error
type UnsafeBrokerServer ¶
type UnsafeBrokerServer interface {
// contains filtered or unexported methods
}
UnsafeBrokerServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to BrokerServer will result in compilation errors.