Documentation ¶
Index ¶
- Variables
- func RegisterSubscriberServer(s grpc.ServiceRegistrar, srv SubscriberServer)
- func RegisterTopicsServer(s grpc.ServiceRegistrar, srv TopicsServer)
- type ClientMessage
- func (*ClientMessage) Descriptor() ([]byte, []int)deprecated
- func (m *ClientMessage) GetContent() isClientMessage_Content
- func (x *ClientMessage) GetId() string
- func (x *ClientMessage) GetMessageResponse() *MessageResponse
- func (x *ClientMessage) GetRegistrationRequest() *RegistrationRequest
- func (*ClientMessage) ProtoMessage()
- func (x *ClientMessage) ProtoReflect() protoreflect.Message
- func (x *ClientMessage) Reset()
- func (x *ClientMessage) String() string
- type ClientMessage_MessageResponse
- type ClientMessage_RegistrationRequest
- type MessageRequest
- func (*MessageRequest) Descriptor() ([]byte, []int)deprecated
- func (x *MessageRequest) GetMessage() *TopicMessage
- func (x *MessageRequest) GetTopicName() string
- func (*MessageRequest) ProtoMessage()
- func (x *MessageRequest) ProtoReflect() protoreflect.Message
- func (x *MessageRequest) Reset()
- func (x *MessageRequest) String() string
- type MessageResponse
- type RegistrationRequest
- func (*RegistrationRequest) Descriptor() ([]byte, []int)deprecated
- func (x *RegistrationRequest) GetTopicName() string
- func (*RegistrationRequest) ProtoMessage()
- func (x *RegistrationRequest) ProtoReflect() protoreflect.Message
- func (x *RegistrationRequest) Reset()
- func (x *RegistrationRequest) String() string
- type RegistrationResponse
- type ServerMessage
- func (*ServerMessage) Descriptor() ([]byte, []int)deprecated
- func (m *ServerMessage) GetContent() isServerMessage_Content
- func (x *ServerMessage) GetId() string
- func (x *ServerMessage) GetMessageRequest() *MessageRequest
- func (x *ServerMessage) GetRegistrationResponse() *RegistrationResponse
- func (*ServerMessage) ProtoMessage()
- func (x *ServerMessage) ProtoReflect() protoreflect.Message
- func (x *ServerMessage) Reset()
- func (x *ServerMessage) String() string
- type ServerMessage_MessageRequest
- type ServerMessage_RegistrationResponse
- type SubscriberClient
- type SubscriberServer
- type Subscriber_SubscribeClient
- type Subscriber_SubscribeServer
- type TopicMessage
- func (*TopicMessage) Descriptor() ([]byte, []int)deprecated
- func (m *TopicMessage) GetContent() isTopicMessage_Content
- func (x *TopicMessage) GetStructPayload() *structpb.Struct
- func (*TopicMessage) ProtoMessage()
- func (x *TopicMessage) ProtoReflect() protoreflect.Message
- func (x *TopicMessage) Reset()
- func (x *TopicMessage) String() string
- type TopicMessage_StructPayload
- type TopicPublishRequest
- func (*TopicPublishRequest) Descriptor() ([]byte, []int)deprecated
- func (x *TopicPublishRequest) GetDelay() *durationpb.Duration
- func (x *TopicPublishRequest) GetMessage() *TopicMessage
- func (x *TopicPublishRequest) GetTopicName() string
- func (*TopicPublishRequest) ProtoMessage()
- func (x *TopicPublishRequest) ProtoReflect() protoreflect.Message
- func (x *TopicPublishRequest) Reset()
- func (x *TopicPublishRequest) String() string
- type TopicPublishResponse
- type TopicsClient
- type TopicsServer
- type UnimplementedSubscriberServer
- type UnimplementedTopicsServer
- type UnsafeSubscriberServer
- type UnsafeTopicsServer
Constants ¶
This section is empty.
Variables ¶
var File_nitric_proto_topics_v1_topics_proto protoreflect.FileDescriptor
var Subscriber_ServiceDesc = grpc.ServiceDesc{ ServiceName: "nitric.proto.topics.v1.Subscriber", HandlerType: (*SubscriberServer)(nil), Methods: []grpc.MethodDesc{}, Streams: []grpc.StreamDesc{ { StreamName: "Subscribe", Handler: _Subscriber_Subscribe_Handler, ServerStreams: true, ClientStreams: true, }, }, Metadata: "nitric/proto/topics/v1/topics.proto", }
Subscriber_ServiceDesc is the grpc.ServiceDesc for Subscriber service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var Topics_ServiceDesc = grpc.ServiceDesc{ ServiceName: "nitric.proto.topics.v1.Topics", HandlerType: (*TopicsServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Publish", Handler: _Topics_Publish_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "nitric/proto/topics/v1/topics.proto", }
Topics_ServiceDesc is the grpc.ServiceDesc for Topics service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterSubscriberServer ¶
func RegisterSubscriberServer(s grpc.ServiceRegistrar, srv SubscriberServer)
func RegisterTopicsServer ¶
func RegisterTopicsServer(s grpc.ServiceRegistrar, srv TopicsServer)
Types ¶
type ClientMessage ¶
type ClientMessage struct { // globally unique ID of the request/response pair Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // Types that are assignable to Content: // // *ClientMessage_RegistrationRequest // *ClientMessage_MessageResponse Content isClientMessage_Content `protobuf_oneof:"content"` // contains filtered or unexported fields }
ClientMessage is the message sent from the service to the nitric server
func (*ClientMessage) Descriptor
deprecated
func (*ClientMessage) Descriptor() ([]byte, []int)
Deprecated: Use ClientMessage.ProtoReflect.Descriptor instead.
func (*ClientMessage) GetContent ¶
func (m *ClientMessage) GetContent() isClientMessage_Content
func (*ClientMessage) GetId ¶
func (x *ClientMessage) GetId() string
func (*ClientMessage) GetMessageResponse ¶
func (x *ClientMessage) GetMessageResponse() *MessageResponse
func (*ClientMessage) GetRegistrationRequest ¶
func (x *ClientMessage) GetRegistrationRequest() *RegistrationRequest
func (*ClientMessage) ProtoMessage ¶
func (*ClientMessage) ProtoMessage()
func (*ClientMessage) ProtoReflect ¶
func (x *ClientMessage) ProtoReflect() protoreflect.Message
func (*ClientMessage) Reset ¶
func (x *ClientMessage) Reset()
func (*ClientMessage) String ¶
func (x *ClientMessage) String() string
type ClientMessage_MessageResponse ¶
type ClientMessage_MessageResponse struct { // Handle a message received from a topic MessageResponse *MessageResponse `protobuf:"bytes,3,opt,name=message_response,json=messageResponse,proto3,oneof"` }
type ClientMessage_RegistrationRequest ¶
type ClientMessage_RegistrationRequest struct { // Register a subscription to a topic RegistrationRequest *RegistrationRequest `protobuf:"bytes,2,opt,name=registration_request,json=registrationRequest,proto3,oneof"` }
type MessageRequest ¶
type MessageRequest struct { TopicName string `protobuf:"bytes,1,opt,name=topic_name,json=topicName,proto3" json:"topic_name,omitempty"` // Message Type Message *TopicMessage `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` // contains filtered or unexported fields }
func (*MessageRequest) Descriptor
deprecated
func (*MessageRequest) Descriptor() ([]byte, []int)
Deprecated: Use MessageRequest.ProtoReflect.Descriptor instead.
func (*MessageRequest) GetMessage ¶
func (x *MessageRequest) GetMessage() *TopicMessage
func (*MessageRequest) GetTopicName ¶
func (x *MessageRequest) GetTopicName() string
func (*MessageRequest) ProtoMessage ¶
func (*MessageRequest) ProtoMessage()
func (*MessageRequest) ProtoReflect ¶
func (x *MessageRequest) ProtoReflect() protoreflect.Message
func (*MessageRequest) Reset ¶
func (x *MessageRequest) Reset()
func (*MessageRequest) String ¶
func (x *MessageRequest) String() string
type MessageResponse ¶
type MessageResponse struct { Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` // contains filtered or unexported fields }
func (*MessageResponse) Descriptor
deprecated
func (*MessageResponse) Descriptor() ([]byte, []int)
Deprecated: Use MessageResponse.ProtoReflect.Descriptor instead.
func (*MessageResponse) GetSuccess ¶
func (x *MessageResponse) GetSuccess() bool
func (*MessageResponse) ProtoMessage ¶
func (*MessageResponse) ProtoMessage()
func (*MessageResponse) ProtoReflect ¶
func (x *MessageResponse) ProtoReflect() protoreflect.Message
func (*MessageResponse) Reset ¶
func (x *MessageResponse) Reset()
func (*MessageResponse) String ¶
func (x *MessageResponse) String() string
type RegistrationRequest ¶
type RegistrationRequest struct { TopicName string `protobuf:"bytes,1,opt,name=topic_name,json=topicName,proto3" json:"topic_name,omitempty"` // contains filtered or unexported fields }
func (*RegistrationRequest) Descriptor
deprecated
func (*RegistrationRequest) Descriptor() ([]byte, []int)
Deprecated: Use RegistrationRequest.ProtoReflect.Descriptor instead.
func (*RegistrationRequest) GetTopicName ¶
func (x *RegistrationRequest) GetTopicName() string
func (*RegistrationRequest) ProtoMessage ¶
func (*RegistrationRequest) ProtoMessage()
func (*RegistrationRequest) ProtoReflect ¶
func (x *RegistrationRequest) ProtoReflect() protoreflect.Message
func (*RegistrationRequest) Reset ¶
func (x *RegistrationRequest) Reset()
func (*RegistrationRequest) String ¶
func (x *RegistrationRequest) String() string
type RegistrationResponse ¶
type RegistrationResponse struct {
// contains filtered or unexported fields
}
func (*RegistrationResponse) Descriptor
deprecated
func (*RegistrationResponse) Descriptor() ([]byte, []int)
Deprecated: Use RegistrationResponse.ProtoReflect.Descriptor instead.
func (*RegistrationResponse) ProtoMessage ¶
func (*RegistrationResponse) ProtoMessage()
func (*RegistrationResponse) ProtoReflect ¶
func (x *RegistrationResponse) ProtoReflect() protoreflect.Message
func (*RegistrationResponse) Reset ¶
func (x *RegistrationResponse) Reset()
func (*RegistrationResponse) String ¶
func (x *RegistrationResponse) String() string
type ServerMessage ¶
type ServerMessage struct { // globally unique ID of the request/response pair Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // Types that are assignable to Content: // // *ServerMessage_RegistrationResponse // *ServerMessage_MessageRequest Content isServerMessage_Content `protobuf_oneof:"content"` // contains filtered or unexported fields }
ServerMessage is the message sent from the nitric server to the service
func (*ServerMessage) Descriptor
deprecated
func (*ServerMessage) Descriptor() ([]byte, []int)
Deprecated: Use ServerMessage.ProtoReflect.Descriptor instead.
func (*ServerMessage) GetContent ¶
func (m *ServerMessage) GetContent() isServerMessage_Content
func (*ServerMessage) GetId ¶
func (x *ServerMessage) GetId() string
func (*ServerMessage) GetMessageRequest ¶
func (x *ServerMessage) GetMessageRequest() *MessageRequest
func (*ServerMessage) GetRegistrationResponse ¶
func (x *ServerMessage) GetRegistrationResponse() *RegistrationResponse
func (*ServerMessage) ProtoMessage ¶
func (*ServerMessage) ProtoMessage()
func (*ServerMessage) ProtoReflect ¶
func (x *ServerMessage) ProtoReflect() protoreflect.Message
func (*ServerMessage) Reset ¶
func (x *ServerMessage) Reset()
func (*ServerMessage) String ¶
func (x *ServerMessage) String() string
type ServerMessage_MessageRequest ¶
type ServerMessage_MessageRequest struct { // Response to a topic message request MessageRequest *MessageRequest `protobuf:"bytes,3,opt,name=message_request,json=messageRequest,proto3,oneof"` }
type ServerMessage_RegistrationResponse ¶
type ServerMessage_RegistrationResponse struct { // Response to a topic subscription request RegistrationResponse *RegistrationResponse `protobuf:"bytes,2,opt,name=registration_response,json=registrationResponse,proto3,oneof"` }
type SubscriberClient ¶
type SubscriberClient interface { // Subscribe to a topic and handle incoming messages Subscribe(ctx context.Context, opts ...grpc.CallOption) (Subscriber_SubscribeClient, error) }
SubscriberClient is the client API for Subscriber 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 NewSubscriberClient ¶
func NewSubscriberClient(cc grpc.ClientConnInterface) SubscriberClient
type SubscriberServer ¶
type SubscriberServer interface { // Subscribe to a topic and handle incoming messages Subscribe(Subscriber_SubscribeServer) error }
SubscriberServer is the server API for Subscriber service. All implementations should embed UnimplementedSubscriberServer for forward compatibility
type Subscriber_SubscribeClient ¶
type Subscriber_SubscribeClient interface { Send(*ClientMessage) error Recv() (*ServerMessage, error) grpc.ClientStream }
type Subscriber_SubscribeServer ¶
type Subscriber_SubscribeServer interface { Send(*ServerMessage) error Recv() (*ClientMessage, error) grpc.ServerStream }
type TopicMessage ¶
type TopicMessage struct { // The topic message contents // // Types that are assignable to Content: // // *TopicMessage_StructPayload Content isTopicMessage_Content `protobuf_oneof:"content"` // contains filtered or unexported fields }
func (*TopicMessage) Descriptor
deprecated
func (*TopicMessage) Descriptor() ([]byte, []int)
Deprecated: Use TopicMessage.ProtoReflect.Descriptor instead.
func (*TopicMessage) GetContent ¶
func (m *TopicMessage) GetContent() isTopicMessage_Content
func (*TopicMessage) GetStructPayload ¶
func (x *TopicMessage) GetStructPayload() *structpb.Struct
func (*TopicMessage) ProtoMessage ¶
func (*TopicMessage) ProtoMessage()
func (*TopicMessage) ProtoReflect ¶
func (x *TopicMessage) ProtoReflect() protoreflect.Message
func (*TopicMessage) Reset ¶
func (x *TopicMessage) Reset()
func (*TopicMessage) String ¶
func (x *TopicMessage) String() string
type TopicPublishRequest ¶
type TopicPublishRequest struct { // The name of the topic to publish the topic to TopicName string `protobuf:"bytes,1,opt,name=topic_name,json=topicName,proto3" json:"topic_name,omitempty"` // The message to be published Message *TopicMessage `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` // An optional delay specified in seconds (minimum 10 seconds) Delay *durationpb.Duration `protobuf:"bytes,3,opt,name=delay,proto3" json:"delay,omitempty"` // contains filtered or unexported fields }
Request to publish a message to a topic
func (*TopicPublishRequest) Descriptor
deprecated
func (*TopicPublishRequest) Descriptor() ([]byte, []int)
Deprecated: Use TopicPublishRequest.ProtoReflect.Descriptor instead.
func (*TopicPublishRequest) GetDelay ¶
func (x *TopicPublishRequest) GetDelay() *durationpb.Duration
func (*TopicPublishRequest) GetMessage ¶
func (x *TopicPublishRequest) GetMessage() *TopicMessage
func (*TopicPublishRequest) GetTopicName ¶
func (x *TopicPublishRequest) GetTopicName() string
func (*TopicPublishRequest) ProtoMessage ¶
func (*TopicPublishRequest) ProtoMessage()
func (*TopicPublishRequest) ProtoReflect ¶
func (x *TopicPublishRequest) ProtoReflect() protoreflect.Message
func (*TopicPublishRequest) Reset ¶
func (x *TopicPublishRequest) Reset()
func (*TopicPublishRequest) String ¶
func (x *TopicPublishRequest) String() string
type TopicPublishResponse ¶
type TopicPublishResponse struct {
// contains filtered or unexported fields
}
Result of publishing an topic
func (*TopicPublishResponse) Descriptor
deprecated
func (*TopicPublishResponse) Descriptor() ([]byte, []int)
Deprecated: Use TopicPublishResponse.ProtoReflect.Descriptor instead.
func (*TopicPublishResponse) ProtoMessage ¶
func (*TopicPublishResponse) ProtoMessage()
func (*TopicPublishResponse) ProtoReflect ¶
func (x *TopicPublishResponse) ProtoReflect() protoreflect.Message
func (*TopicPublishResponse) Reset ¶
func (x *TopicPublishResponse) Reset()
func (*TopicPublishResponse) String ¶
func (x *TopicPublishResponse) String() string
type TopicsClient ¶
type TopicsClient interface { // Publishes a message to a given topic Publish(ctx context.Context, in *TopicPublishRequest, opts ...grpc.CallOption) (*TopicPublishResponse, error) }
TopicsClient is the client API for Topics 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 NewTopicsClient ¶
func NewTopicsClient(cc grpc.ClientConnInterface) TopicsClient
type TopicsServer ¶
type TopicsServer interface { // Publishes a message to a given topic Publish(context.Context, *TopicPublishRequest) (*TopicPublishResponse, error) }
TopicsServer is the server API for Topics service. All implementations should embed UnimplementedTopicsServer for forward compatibility
type UnimplementedSubscriberServer ¶
type UnimplementedSubscriberServer struct { }
UnimplementedSubscriberServer should be embedded to have forward compatible implementations.
func (UnimplementedSubscriberServer) Subscribe ¶
func (UnimplementedSubscriberServer) Subscribe(Subscriber_SubscribeServer) error
type UnimplementedTopicsServer ¶
type UnimplementedTopicsServer struct { }
UnimplementedTopicsServer should be embedded to have forward compatible implementations.
func (UnimplementedTopicsServer) Publish ¶
func (UnimplementedTopicsServer) Publish(context.Context, *TopicPublishRequest) (*TopicPublishResponse, error)
type UnsafeSubscriberServer ¶
type UnsafeSubscriberServer interface {
// contains filtered or unexported methods
}
UnsafeSubscriberServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to SubscriberServer will result in compilation errors.
type UnsafeTopicsServer ¶
type UnsafeTopicsServer interface {
// contains filtered or unexported methods
}
UnsafeTopicsServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to TopicsServer will result in compilation errors.