Documentation ¶
Index ¶
- Constants
- func NewConsumerHandler(svc ConsumerHandler, opts ...connect.HandlerOption) (string, http.Handler)
- func NewProducerHandler(svc ProducerHandler, opts ...connect.HandlerOption) (string, http.Handler)
- type ConsumerClient
- type ConsumerHandler
- type ProducerClient
- type ProducerHandler
- type UnimplementedConsumerHandler
- type UnimplementedProducerHandler
Constants ¶
const (
// ConsumerConsumeProcedure is the fully-qualified name of the Consumer's Consume RPC.
ConsumerConsumeProcedure = "/core.message_broker.actors.v1.Consumer/Consume"
)
These constants are the fully-qualified names of the RPCs defined in this package. They're exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.
Note that these are different from the fully-qualified method names used by google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to reflection-formatted method names, remove the leading slash and convert the remaining slash to a period.
const (
// ConsumerName is the fully-qualified name of the Consumer service.
ConsumerName = "core.message_broker.actors.v1.Consumer"
)
const (
// ProducerName is the fully-qualified name of the Producer service.
ProducerName = "core.message_broker.actors.v1.Producer"
)
const (
// ProducerProduceProcedure is the fully-qualified name of the Producer's Produce RPC.
ProducerProduceProcedure = "/core.message_broker.actors.v1.Producer/Produce"
)
These constants are the fully-qualified names of the RPCs defined in this package. They're exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.
Note that these are different from the fully-qualified method names used by google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to reflection-formatted method names, remove the leading slash and convert the remaining slash to a period.
Variables ¶
This section is empty.
Functions ¶
func NewConsumerHandler ¶
func NewConsumerHandler(svc ConsumerHandler, opts ...connect.HandlerOption) (string, http.Handler)
NewConsumerHandler builds an HTTP handler from the service implementation. It returns the path on which to mount the handler and the handler itself.
By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf and JSON codecs. They also support gzip compression.
func NewProducerHandler ¶
func NewProducerHandler(svc ProducerHandler, opts ...connect.HandlerOption) (string, http.Handler)
NewProducerHandler builds an HTTP handler from the service implementation. It returns the path on which to mount the handler and the handler itself.
By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf and JSON codecs. They also support gzip compression.
Types ¶
type ConsumerClient ¶
type ConsumerClient interface {
Consume(context.Context, *connect.Request[v1.ConsumeRequest]) (*connect.ServerStreamForClient[v1.ConsumeResponse], error)
}
ConsumerClient is a client for the core.message_broker.actors.v1.Consumer service.
func NewConsumerClient ¶
func NewConsumerClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) ConsumerClient
NewConsumerClient constructs a client for the core.message_broker.actors.v1.Consumer service. By default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or connect.WithGRPCWeb() options.
The URL supplied here should be the base URL for the Connect or gRPC server (for example, http://api.acme.com or https://acme.com/grpc).
type ConsumerHandler ¶
type ConsumerHandler interface {
Consume(context.Context, *connect.Request[v1.ConsumeRequest], *connect.ServerStream[v1.ConsumeResponse]) error
}
ConsumerHandler is an implementation of the core.message_broker.actors.v1.Consumer service.
type ProducerClient ¶
type ProducerClient interface {
Produce(context.Context) *connect.BidiStreamForClient[v1.ProduceRequest, v1.ProduceResponse]
}
ProducerClient is a client for the core.message_broker.actors.v1.Producer service.
func NewProducerClient ¶
func NewProducerClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) ProducerClient
NewProducerClient constructs a client for the core.message_broker.actors.v1.Producer service. By default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or connect.WithGRPCWeb() options.
The URL supplied here should be the base URL for the Connect or gRPC server (for example, http://api.acme.com or https://acme.com/grpc).
type ProducerHandler ¶
type ProducerHandler interface {
Produce(context.Context, *connect.BidiStream[v1.ProduceRequest, v1.ProduceResponse]) error
}
ProducerHandler is an implementation of the core.message_broker.actors.v1.Producer service.
type UnimplementedConsumerHandler ¶
type UnimplementedConsumerHandler struct{}
UnimplementedConsumerHandler returns CodeUnimplemented from all methods.
func (UnimplementedConsumerHandler) Consume ¶
func (UnimplementedConsumerHandler) Consume(context.Context, *connect.Request[v1.ConsumeRequest], *connect.ServerStream[v1.ConsumeResponse]) error
type UnimplementedProducerHandler ¶
type UnimplementedProducerHandler struct{}
UnimplementedProducerHandler returns CodeUnimplemented from all methods.
func (UnimplementedProducerHandler) Produce ¶
func (UnimplementedProducerHandler) Produce(context.Context, *connect.BidiStream[v1.ProduceRequest, v1.ProduceResponse]) error