Documentation
¶
Index ¶
- Constants
- Variables
- func RegisterBrokerHandler(s server.Server, hdlr BrokerHandler, opts ...server.HandlerOption) error
- func RegisterBrokerServer(s grpc.ServiceRegistrar, srv BrokerServer)
- type BrokerClient
- type BrokerHandler
- type BrokerServer
- type BrokerService
- type Empty
- type Message
- func (*Message) Descriptor() ([]byte, []int)deprecated
- func (x *Message) GetBody() []byte
- func (x *Message) GetHeader() map[string]string
- func (x *Message) GetId() string
- func (x *Message) GetTopic() string
- func (*Message) ProtoMessage()
- func (x *Message) ProtoReflect() protoreflect.Message
- func (x *Message) Reset()
- func (x *Message) String() string
- type UnimplementedBrokerServer
- type UnsafeBrokerServer
Constants ¶
const (
Broker_Publish_FullMethodName = "/Broker/Publish"
)
Variables ¶
var Broker_ServiceDesc = grpc.ServiceDesc{ ServiceName: "Broker", HandlerType: (*BrokerServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Publish", Handler: _Broker_Publish_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "proto/broker.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_proto_broker_proto protoreflect.FileDescriptor
Functions ¶
func RegisterBrokerHandler ¶
func RegisterBrokerHandler(s server.Server, hdlr BrokerHandler, opts ...server.HandlerOption) error
func RegisterBrokerServer ¶
func RegisterBrokerServer(s grpc.ServiceRegistrar, srv BrokerServer)
Types ¶
type BrokerClient ¶
type BrokerClient interface {
Publish(ctx context.Context, in *Message, opts ...grpc.CallOption) (*Empty, 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 BrokerHandler ¶
type BrokerServer ¶
type BrokerServer interface {
Publish(context.Context, *Message) (*Empty, error)
// contains filtered or unexported methods
}
BrokerServer is the server API for Broker service. All implementations must embed UnimplementedBrokerServer for forward compatibility.
type BrokerService ¶
type BrokerService interface {
Publish(ctx context.Context, in *Message, opts ...client.CallOption) (*Empty, error)
}
func NewBrokerService ¶
func NewBrokerService(name string, c client.Client) BrokerService
type Empty ¶
type Empty struct {
// contains filtered or unexported fields
}
func (*Empty) Descriptor
deprecated
func (*Empty) ProtoMessage ¶
func (*Empty) ProtoMessage()
func (*Empty) ProtoReflect ¶
func (x *Empty) ProtoReflect() protoreflect.Message
type Message ¶
type Message struct {
Topic string `protobuf:"bytes,1,opt,name=topic,proto3" json:"topic,omitempty"`
Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
Header map[string]string `` /* 153-byte string literal not displayed */
Body []byte `protobuf:"bytes,4,opt,name=body,proto3" json:"body,omitempty"`
// contains filtered or unexported fields
}
func (*Message) Descriptor
deprecated
func (*Message) ProtoMessage ¶
func (*Message) ProtoMessage()
func (*Message) ProtoReflect ¶
func (x *Message) ProtoReflect() protoreflect.Message
type UnimplementedBrokerServer ¶
type UnimplementedBrokerServer struct{}
UnimplementedBrokerServer must be embedded to have forward compatible implementations.
NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.
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.