Documentation ¶
Overview ¶
Package eventgate is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterEventGateServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterEventGateServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client EventGateServiceClient) error
- func RegisterEventGateServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterEventGateServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server EventGateServiceServer) error
- func RegisterEventGateServiceServer(s *grpc.Server, srv EventGateServiceServer)
- type Event
- func (*Event) Descriptor() ([]byte, []int)deprecated
- func (x *Event) GetChannel() string
- func (x *Event) GetData() *_struct.Struct
- func (x *Event) GetId() string
- func (x *Event) GetMetadata() map[string]string
- func (x *Event) GetTime() *timestamp.Timestamp
- func (*Event) ProtoMessage()
- func (x *Event) ProtoReflect() protoreflect.Message
- func (x *Event) Reset()
- func (x *Event) String() string
- func (this *Event) Validate() error
- type EventGateServiceClient
- type EventGateServiceServer
- type EventGateService_ReceiveClient
- type EventGateService_ReceiveServer
- type ReceiveOpts
- func (*ReceiveOpts) Descriptor() ([]byte, []int)deprecated
- func (x *ReceiveOpts) GetChannel() string
- func (x *ReceiveOpts) GetConsumerGroup() string
- func (*ReceiveOpts) ProtoMessage()
- func (x *ReceiveOpts) ProtoReflect() protoreflect.Message
- func (x *ReceiveOpts) Reset()
- func (x *ReceiveOpts) String() string
- func (this *ReceiveOpts) Validate() error
- type UnimplementedEventGateServiceServer
Constants ¶
This section is empty.
Variables ¶
var File_schema_proto protoreflect.FileDescriptor
Functions ¶
func RegisterEventGateServiceHandler ¶ added in v0.0.6
func RegisterEventGateServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterEventGateServiceHandler registers the http handlers for service EventGateService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterEventGateServiceHandlerClient ¶ added in v0.0.6
func RegisterEventGateServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client EventGateServiceClient) error
RegisterEventGateServiceHandlerClient registers the http handlers for service EventGateService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "EventGateServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "EventGateServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "EventGateServiceClient" to call the correct interceptors.
func RegisterEventGateServiceHandlerFromEndpoint ¶ added in v0.0.6
func RegisterEventGateServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterEventGateServiceHandlerFromEndpoint is same as RegisterEventGateServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterEventGateServiceHandlerServer ¶ added in v0.0.6
func RegisterEventGateServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server EventGateServiceServer) error
RegisterEventGateServiceHandlerServer registers the http handlers for service EventGateService to "mux". UnaryRPC :call EventGateServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterEventGateServiceHandlerFromEndpoint instead.
func RegisterEventGateServiceServer ¶ added in v0.0.6
func RegisterEventGateServiceServer(s *grpc.Server, srv EventGateServiceServer)
Types ¶
type Event ¶ added in v0.0.10
type Event struct { // Identifies the event. If an ID is not sent with the event, a uuid will be assigned Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // Identifies the channel/subject to which the event will be sent Channel string `protobuf:"bytes,2,opt,name=channel,proto3" json:"channel,omitempty"` // The event payload(structured). Data *_struct.Struct `protobuf:"bytes,5,opt,name=data,proto3" json:"data,omitempty"` // Arbitrary metadata about the event Metadata map[string]string `` /* 157-byte string literal not displayed */ // Timestamp of when the occurrence happened. Must adhere to RFC 3339. If a timestamp is not sent with the event, the current time will be assigned Time *timestamp.Timestamp `protobuf:"bytes,20,opt,name=time,proto3" json:"time,omitempty"` // contains filtered or unexported fields }
Event is a specification for describing event data
func (*Event) Descriptor
deprecated
added in
v0.0.10
func (*Event) GetChannel ¶ added in v0.0.10
func (*Event) GetMetadata ¶ added in v0.0.10
func (*Event) ProtoMessage ¶ added in v0.0.10
func (*Event) ProtoMessage()
func (*Event) ProtoReflect ¶ added in v0.0.10
func (x *Event) ProtoReflect() protoreflect.Message
type EventGateServiceClient ¶ added in v0.0.6
type EventGateServiceClient interface { // Broadcast an event(one way) Send(ctx context.Context, in *Event, opts ...grpc.CallOption) (*empty.Empty, error) // Receive streams events to a client that pass a Filter Receive(ctx context.Context, in *ReceiveOpts, opts ...grpc.CallOption) (EventGateService_ReceiveClient, error) }
EventGateServiceClient is the client API for EventGateService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewEventGateServiceClient ¶ added in v0.0.6
func NewEventGateServiceClient(cc grpc.ClientConnInterface) EventGateServiceClient
type EventGateServiceServer ¶ added in v0.0.6
type EventGateServiceServer interface { // Broadcast an event(one way) Send(context.Context, *Event) (*empty.Empty, error) // Receive streams events to a client that pass a Filter Receive(*ReceiveOpts, EventGateService_ReceiveServer) error }
EventGateServiceServer is the server API for EventGateService service.
type EventGateService_ReceiveClient ¶ added in v0.0.6
type EventGateService_ReceiveClient interface { Recv() (*Event, error) grpc.ClientStream }
type EventGateService_ReceiveServer ¶ added in v0.0.6
type EventGateService_ReceiveServer interface { Send(*Event) error grpc.ServerStream }
type ReceiveOpts ¶ added in v0.0.12
type ReceiveOpts struct { Channel string `protobuf:"bytes,1,opt,name=channel,proto3" json:"channel,omitempty"` ConsumerGroup string `protobuf:"bytes,2,opt,name=consumer_group,json=consumerGroup,proto3" json:"consumer_group,omitempty"` // contains filtered or unexported fields }
ReceiveOpts filters events before they are received by a consumer
func (*ReceiveOpts) Descriptor
deprecated
added in
v0.0.12
func (*ReceiveOpts) Descriptor() ([]byte, []int)
Deprecated: Use ReceiveOpts.ProtoReflect.Descriptor instead.
func (*ReceiveOpts) GetChannel ¶ added in v0.0.12
func (x *ReceiveOpts) GetChannel() string
func (*ReceiveOpts) GetConsumerGroup ¶ added in v0.0.12
func (x *ReceiveOpts) GetConsumerGroup() string
func (*ReceiveOpts) ProtoMessage ¶ added in v0.0.12
func (*ReceiveOpts) ProtoMessage()
func (*ReceiveOpts) ProtoReflect ¶ added in v0.0.12
func (x *ReceiveOpts) ProtoReflect() protoreflect.Message
func (*ReceiveOpts) Reset ¶ added in v0.0.12
func (x *ReceiveOpts) Reset()
func (*ReceiveOpts) String ¶ added in v0.0.12
func (x *ReceiveOpts) String() string
func (*ReceiveOpts) Validate ¶ added in v0.0.12
func (this *ReceiveOpts) Validate() error
type UnimplementedEventGateServiceServer ¶ added in v0.0.6
type UnimplementedEventGateServiceServer struct { }
UnimplementedEventGateServiceServer can be embedded to have forward compatible implementations.
func (*UnimplementedEventGateServiceServer) Receive ¶ added in v0.0.6
func (*UnimplementedEventGateServiceServer) Receive(*ReceiveOpts, EventGateService_ReceiveServer) error