broker

package
v3.10.7 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Broker_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "broker.Broker",
	HandlerType: (*BrokerServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Publish",
			Handler:    _Broker_Publish_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Subscribe",
			Handler:       _Broker_Subscribe_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "proto/broker/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)

View Source
var File_proto_broker_broker_proto protoreflect.FileDescriptor

Functions

func NewBrokerEndpoints

func NewBrokerEndpoints() []*api.Endpoint

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 *PublishRequest, opts ...grpc.CallOption) (*Empty, error)
	Subscribe(ctx context.Context, in *SubscribeRequest, opts ...grpc.CallOption) (Broker_SubscribeClient, 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 BrokerHandler interface {
	Publish(context.Context, *PublishRequest, *Empty) error
	Subscribe(context.Context, *SubscribeRequest, Broker_SubscribeStream) error
}

type BrokerServer

type BrokerServer interface {
	Publish(context.Context, *PublishRequest) (*Empty, error)
	Subscribe(*SubscribeRequest, Broker_SubscribeServer) 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 *PublishRequest, opts ...client.CallOption) (*Empty, error)
	Subscribe(ctx context.Context, in *SubscribeRequest, opts ...client.CallOption) (Broker_SubscribeService, error)
}

func NewBrokerService

func NewBrokerService(name string, c client.Client) BrokerService

type Broker_SubscribeClient

type Broker_SubscribeClient interface {
	Recv() (*Message, error)
	grpc.ClientStream
}

type Broker_SubscribeServer

type Broker_SubscribeServer interface {
	Send(*Message) error
	grpc.ServerStream
}

type Broker_SubscribeService

type Broker_SubscribeService interface {
	Context() context.Context
	SendMsg(interface{}) error
	RecvMsg(interface{}) error
	Close() error
	Recv() (*Message, error)
}

type Broker_SubscribeStream

type Broker_SubscribeStream interface {
	Context() context.Context
	SendMsg(interface{}) error
	RecvMsg(interface{}) error
	Close() error
	Send(*Message) error
}

type Empty

type Empty struct {
	// contains filtered or unexported fields
}

func (*Empty) Descriptor deprecated

func (*Empty) Descriptor() ([]byte, []int)

Deprecated: Use Empty.ProtoReflect.Descriptor instead.

func (*Empty) ProtoMessage

func (*Empty) ProtoMessage()

func (*Empty) ProtoReflect

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

func (*Empty) Reset

func (x *Empty) Reset()

func (*Empty) String

func (x *Empty) String() string

type Message

type Message struct {
	Header map[string]string `` /* 153-byte string literal not displayed */
	Body   []byte            `protobuf:"bytes,2,opt,name=body,proto3" json:"body,omitempty"`
	// contains filtered or unexported fields
}

func (*Message) Descriptor deprecated

func (*Message) Descriptor() ([]byte, []int)

Deprecated: Use Message.ProtoReflect.Descriptor instead.

func (*Message) GetBody

func (x *Message) GetBody() []byte

func (*Message) GetHeader

func (x *Message) GetHeader() map[string]string

func (*Message) ProtoMessage

func (*Message) ProtoMessage()

func (*Message) ProtoReflect

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

func (*Message) Reset

func (x *Message) Reset()

func (*Message) String

func (x *Message) String() string

type PublishRequest

type PublishRequest struct {
	Topic   string   `protobuf:"bytes,1,opt,name=topic,proto3" json:"topic,omitempty"`
	Message *Message `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
	// contains filtered or unexported fields
}

func (*PublishRequest) Descriptor deprecated

func (*PublishRequest) Descriptor() ([]byte, []int)

Deprecated: Use PublishRequest.ProtoReflect.Descriptor instead.

func (*PublishRequest) GetMessage

func (x *PublishRequest) GetMessage() *Message

func (*PublishRequest) GetTopic

func (x *PublishRequest) GetTopic() string

func (*PublishRequest) ProtoMessage

func (*PublishRequest) ProtoMessage()

func (*PublishRequest) ProtoReflect

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

func (*PublishRequest) Reset

func (x *PublishRequest) Reset()

func (*PublishRequest) String

func (x *PublishRequest) String() string

type SubscribeRequest

type SubscribeRequest struct {
	Topic string `protobuf:"bytes,1,opt,name=topic,proto3" json:"topic,omitempty"`
	Queue string `protobuf:"bytes,2,opt,name=queue,proto3" json:"queue,omitempty"`
	// contains filtered or unexported fields
}

func (*SubscribeRequest) Descriptor deprecated

func (*SubscribeRequest) Descriptor() ([]byte, []int)

Deprecated: Use SubscribeRequest.ProtoReflect.Descriptor instead.

func (*SubscribeRequest) GetQueue

func (x *SubscribeRequest) GetQueue() string

func (*SubscribeRequest) GetTopic

func (x *SubscribeRequest) GetTopic() string

func (*SubscribeRequest) ProtoMessage

func (*SubscribeRequest) ProtoMessage()

func (*SubscribeRequest) ProtoReflect

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

func (*SubscribeRequest) Reset

func (x *SubscribeRequest) Reset()

func (*SubscribeRequest) String

func (x *SubscribeRequest) String() string

type UnimplementedBrokerServer

type UnimplementedBrokerServer struct {
}

UnimplementedBrokerServer must be embedded to have forward compatible implementations.

func (UnimplementedBrokerServer) Publish

func (UnimplementedBrokerServer) Subscribe

type UnsafeBrokerServer added in v3.10.4

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.

Jump to

Keyboard shortcuts

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