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) GetClaims() *_struct.Struct
- func (x *Event) GetData() *_struct.Struct
- func (x *Event) GetId() string
- func (x *Event) GetMetadata() *_struct.Struct
- 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 Events
- type HistoryOpts
- func (*HistoryOpts) Descriptor() ([]byte, []int)deprecated
- func (x *HistoryOpts) GetChannel() string
- func (x *HistoryOpts) GetLimit() int64
- func (x *HistoryOpts) GetMax() *timestamp.Timestamp
- func (x *HistoryOpts) GetMin() *timestamp.Timestamp
- func (x *HistoryOpts) GetOffset() int64
- func (*HistoryOpts) ProtoMessage()
- func (x *HistoryOpts) ProtoReflect() protoreflect.Message
- func (x *HistoryOpts) Reset()
- func (x *HistoryOpts) String() string
- func (this *HistoryOpts) Validate() error
- type ReceiveOpts
- func (*ReceiveOpts) Descriptor() ([]byte, []int)deprecated
- func (x *ReceiveOpts) GetChannel() 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 *_struct.Struct `protobuf:"bytes,6,opt,name=metadata,proto3" json:"metadata,omitempty"` // The authentication claims of the event producer. This field is read-only & populated/overriden by the server before it is broadcasted to consumers. Claims *_struct.Struct `protobuf:"bytes,7,opt,name=claims,proto3" json:"claims,omitempty"` // 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 { // Send broadcasts an event to all consumers on a given channel. Producers invoke this method. Send(ctx context.Context, in *Event, opts ...grpc.CallOption) (*empty.Empty, error) // Receive creates an event stream/subscription to a given channel until fn returns false OR the context cancels. // Event Consumers invoke this method. Receive(ctx context.Context, in *ReceiveOpts, opts ...grpc.CallOption) (EventGateService_ReceiveClient, error) // History returns an array of immutable historical events. // Event Consumers invoke this method. History(ctx context.Context, in *HistoryOpts, opts ...grpc.CallOption) (*Events, 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 { // Send broadcasts an event to all consumers on a given channel. Producers invoke this method. Send(context.Context, *Event) (*empty.Empty, error) // Receive creates an event stream/subscription to a given channel until fn returns false OR the context cancels. // Event Consumers invoke this method. Receive(*ReceiveOpts, EventGateService_ReceiveServer) error // History returns an array of immutable historical events. // Event Consumers invoke this method. History(context.Context, *HistoryOpts) (*Events, 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 Events ¶ added in v0.0.17
type Events struct { Events []*Event `protobuf:"bytes,1,rep,name=events,proto3" json:"events,omitempty"` // contains filtered or unexported fields }
Events is an array of events
func (*Events) Descriptor
deprecated
added in
v0.0.17
func (*Events) ProtoMessage ¶ added in v0.0.17
func (*Events) ProtoMessage()
func (*Events) ProtoReflect ¶ added in v0.0.17
func (x *Events) ProtoReflect() protoreflect.Message
type HistoryOpts ¶ added in v0.0.17
type HistoryOpts struct { Channel string `protobuf:"bytes,1,opt,name=channel,proto3" json:"channel,omitempty"` // only return events that occurred after specified min timestamp Min *timestamp.Timestamp `protobuf:"bytes,2,opt,name=min,proto3" json:"min,omitempty"` // only return events that occurred before specified max timestamp Max *timestamp.Timestamp `protobuf:"bytes,3,opt,name=max,proto3" json:"max,omitempty"` // limit returned events Limit int64 `protobuf:"varint,4,opt,name=limit,proto3" json:"limit,omitempty"` // offset returned events(pagination) Offset int64 `protobuf:"varint,5,opt,name=offset,proto3" json:"offset,omitempty"` // contains filtered or unexported fields }
HistoryOpts are options when querying historical events
func (*HistoryOpts) Descriptor
deprecated
added in
v0.0.17
func (*HistoryOpts) Descriptor() ([]byte, []int)
Deprecated: Use HistoryOpts.ProtoReflect.Descriptor instead.
func (*HistoryOpts) GetChannel ¶ added in v0.0.17
func (x *HistoryOpts) GetChannel() string
func (*HistoryOpts) GetLimit ¶ added in v0.0.17
func (x *HistoryOpts) GetLimit() int64
func (*HistoryOpts) GetMax ¶ added in v0.0.17
func (x *HistoryOpts) GetMax() *timestamp.Timestamp
func (*HistoryOpts) GetMin ¶ added in v0.0.17
func (x *HistoryOpts) GetMin() *timestamp.Timestamp
func (*HistoryOpts) GetOffset ¶ added in v0.0.17
func (x *HistoryOpts) GetOffset() int64
func (*HistoryOpts) ProtoMessage ¶ added in v0.0.17
func (*HistoryOpts) ProtoMessage()
func (*HistoryOpts) ProtoReflect ¶ added in v0.0.17
func (x *HistoryOpts) ProtoReflect() protoreflect.Message
func (*HistoryOpts) Reset ¶ added in v0.0.17
func (x *HistoryOpts) Reset()
func (*HistoryOpts) String ¶ added in v0.0.17
func (x *HistoryOpts) String() string
func (*HistoryOpts) Validate ¶ added in v0.0.17
func (this *HistoryOpts) Validate() error
type ReceiveOpts ¶ added in v0.0.12
type ReceiveOpts struct { Channel string `protobuf:"bytes,1,opt,name=channel,proto3" json:"channel,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) 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) History ¶ added in v0.0.17
func (*UnimplementedEventGateServiceServer) History(context.Context, *HistoryOpts) (*Events, error)
func (*UnimplementedEventGateServiceServer) Receive ¶ added in v0.0.6
func (*UnimplementedEventGateServiceServer) Receive(*ReceiveOpts, EventGateService_ReceiveServer) error