eventgate

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2021 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Overview

Package eventgate is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
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) Descriptor() ([]byte, []int)

Deprecated: Use Event.ProtoReflect.Descriptor instead.

func (*Event) GetChannel added in v0.0.10

func (x *Event) GetChannel() string

func (*Event) GetData added in v0.0.10

func (x *Event) GetData() *_struct.Struct

func (*Event) GetId added in v0.0.10

func (x *Event) GetId() string

func (*Event) GetMetadata added in v0.0.10

func (x *Event) GetMetadata() map[string]string

func (*Event) GetTime added in v0.0.10

func (x *Event) GetTime() *timestamp.Timestamp

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

func (*Event) Reset added in v0.0.10

func (x *Event) Reset()

func (*Event) String added in v0.0.10

func (x *Event) String() string

func (*Event) Validate added in v0.0.10

func (this *Event) Validate() error

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) Send added in v0.0.6

Jump to

Keyboard shortcuts

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