Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
372 lines (324 sloc) 12 KB
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: eventing.proto
package gateways
import (
context "context"
fmt "fmt"
proto "github.com/golang/protobuf/proto"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
//*
// Represents an event source
type EventSource struct {
// ID of the event source. internally generated.
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
// The event source name.
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
// The event source configuration value.
Data string `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"`
// Version of the event source
Version string `protobuf:"bytes,4,opt,name=version,proto3" json:"version,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *EventSource) Reset() { *m = EventSource{} }
func (m *EventSource) String() string { return proto.CompactTextString(m) }
func (*EventSource) ProtoMessage() {}
func (*EventSource) Descriptor() ([]byte, []int) {
return fileDescriptor_2abcc01b0da84106, []int{0}
}
func (m *EventSource) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_EventSource.Unmarshal(m, b)
}
func (m *EventSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_EventSource.Marshal(b, m, deterministic)
}
func (m *EventSource) XXX_Merge(src proto.Message) {
xxx_messageInfo_EventSource.Merge(m, src)
}
func (m *EventSource) XXX_Size() int {
return xxx_messageInfo_EventSource.Size(m)
}
func (m *EventSource) XXX_DiscardUnknown() {
xxx_messageInfo_EventSource.DiscardUnknown(m)
}
var xxx_messageInfo_EventSource proto.InternalMessageInfo
func (m *EventSource) GetId() string {
if m != nil {
return m.Id
}
return ""
}
func (m *EventSource) GetName() string {
if m != nil {
return m.Name
}
return ""
}
func (m *EventSource) GetData() string {
if m != nil {
return m.Data
}
return ""
}
func (m *EventSource) GetVersion() string {
if m != nil {
return m.Version
}
return ""
}
//*
// Represents an event
type Event struct {
// The event source name.
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
// The event payload.
Payload []byte `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *Event) Reset() { *m = Event{} }
func (m *Event) String() string { return proto.CompactTextString(m) }
func (*Event) ProtoMessage() {}
func (*Event) Descriptor() ([]byte, []int) {
return fileDescriptor_2abcc01b0da84106, []int{1}
}
func (m *Event) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Event.Unmarshal(m, b)
}
func (m *Event) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Event.Marshal(b, m, deterministic)
}
func (m *Event) XXX_Merge(src proto.Message) {
xxx_messageInfo_Event.Merge(m, src)
}
func (m *Event) XXX_Size() int {
return xxx_messageInfo_Event.Size(m)
}
func (m *Event) XXX_DiscardUnknown() {
xxx_messageInfo_Event.DiscardUnknown(m)
}
var xxx_messageInfo_Event proto.InternalMessageInfo
func (m *Event) GetName() string {
if m != nil {
return m.Name
}
return ""
}
func (m *Event) GetPayload() []byte {
if m != nil {
return m.Payload
}
return nil
}
//*
// Represents if an event source is valid or not
type ValidEventSource struct {
// whether event source is valid
IsValid bool `protobuf:"varint,1,opt,name=isValid,proto3" json:"isValid,omitempty"`
// reason if an event source is invalid
Reason string `protobuf:"bytes,2,opt,name=reason,proto3" json:"reason,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ValidEventSource) Reset() { *m = ValidEventSource{} }
func (m *ValidEventSource) String() string { return proto.CompactTextString(m) }
func (*ValidEventSource) ProtoMessage() {}
func (*ValidEventSource) Descriptor() ([]byte, []int) {
return fileDescriptor_2abcc01b0da84106, []int{2}
}
func (m *ValidEventSource) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ValidEventSource.Unmarshal(m, b)
}
func (m *ValidEventSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ValidEventSource.Marshal(b, m, deterministic)
}
func (m *ValidEventSource) XXX_Merge(src proto.Message) {
xxx_messageInfo_ValidEventSource.Merge(m, src)
}
func (m *ValidEventSource) XXX_Size() int {
return xxx_messageInfo_ValidEventSource.Size(m)
}
func (m *ValidEventSource) XXX_DiscardUnknown() {
xxx_messageInfo_ValidEventSource.DiscardUnknown(m)
}
var xxx_messageInfo_ValidEventSource proto.InternalMessageInfo
func (m *ValidEventSource) GetIsValid() bool {
if m != nil {
return m.IsValid
}
return false
}
func (m *ValidEventSource) GetReason() string {
if m != nil {
return m.Reason
}
return ""
}
func init() {
proto.RegisterType((*EventSource)(nil), "gateways.EventSource")
proto.RegisterType((*Event)(nil), "gateways.Event")
proto.RegisterType((*ValidEventSource)(nil), "gateways.ValidEventSource")
}
func init() { proto.RegisterFile("eventing.proto", fileDescriptor_2abcc01b0da84106) }
var fileDescriptor_2abcc01b0da84106 = []byte{
// 237 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x91, 0xc1, 0x4a, 0xc3, 0x40,
0x10, 0x86, 0xd9, 0x58, 0x9b, 0x38, 0x4a, 0x2d, 0x23, 0xca, 0xd2, 0x93, 0xe4, 0xe4, 0x29, 0x88,
0xe2, 0xcd, 0xa3, 0x05, 0xcf, 0x29, 0x78, 0x95, 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00, 0x00, 0xff, 0xff, 0xf3, 0x93, 0xbe, 0x7e, 0x95, 0x01, 0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion4
// EventingClient is the client API for Eventing service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type EventingClient interface {
// StartEventSource starts an event source and returns stream of events.
StartEventSource(ctx context.Context, in *EventSource, opts ...grpc.CallOption) (Eventing_StartEventSourceClient, error)
// ValidateEventSource validates an event source.
ValidateEventSource(ctx context.Context, in *EventSource, opts ...grpc.CallOption) (*ValidEventSource, error)
}
type eventingClient struct {
cc *grpc.ClientConn
}
func NewEventingClient(cc *grpc.ClientConn) EventingClient {
return &eventingClient{cc}
}
func (c *eventingClient) StartEventSource(ctx context.Context, in *EventSource, opts ...grpc.CallOption) (Eventing_StartEventSourceClient, error) {
stream, err := c.cc.NewStream(ctx, &_Eventing_serviceDesc.Streams[0], "/gateways.Eventing/StartEventSource", opts...)
if err != nil {
return nil, err
}
x := &eventingStartEventSourceClient{stream}
if err := x.ClientStream.SendMsg(in); err != nil {
return nil, err
}
if err := x.ClientStream.CloseSend(); err != nil {
return nil, err
}
return x, nil
}
type Eventing_StartEventSourceClient interface {
Recv() (*Event, error)
grpc.ClientStream
}
type eventingStartEventSourceClient struct {
grpc.ClientStream
}
func (x *eventingStartEventSourceClient) Recv() (*Event, error) {
m := new(Event)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
func (c *eventingClient) ValidateEventSource(ctx context.Context, in *EventSource, opts ...grpc.CallOption) (*ValidEventSource, error) {
out := new(ValidEventSource)
err := c.cc.Invoke(ctx, "/gateways.Eventing/ValidateEventSource", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// EventingServer is the server API for Eventing service.
type EventingServer interface {
// StartEventSource starts an event source and returns stream of events.
StartEventSource(*EventSource, Eventing_StartEventSourceServer) error
// ValidateEventSource validates an event source.
ValidateEventSource(context.Context, *EventSource) (*ValidEventSource, error)
}
// UnimplementedEventingServer can be embedded to have forward compatible implementations.
type UnimplementedEventingServer struct {
}
func (*UnimplementedEventingServer) StartEventSource(req *EventSource, srv Eventing_StartEventSourceServer) error {
return status.Errorf(codes.Unimplemented, "method StartEventSource not implemented")
}
func (*UnimplementedEventingServer) ValidateEventSource(ctx context.Context, req *EventSource) (*ValidEventSource, error) {
return nil, status.Errorf(codes.Unimplemented, "method ValidateEventSource not implemented")
}
func RegisterEventingServer(s *grpc.Server, srv EventingServer) {
s.RegisterService(&_Eventing_serviceDesc, srv)
}
func _Eventing_StartEventSource_Handler(srv interface{}, stream grpc.ServerStream) error {
m := new(EventSource)
if err := stream.RecvMsg(m); err != nil {
return err
}
return srv.(EventingServer).StartEventSource(m, &eventingStartEventSourceServer{stream})
}
type Eventing_StartEventSourceServer interface {
Send(*Event) error
grpc.ServerStream
}
type eventingStartEventSourceServer struct {
grpc.ServerStream
}
func (x *eventingStartEventSourceServer) Send(m *Event) error {
return x.ServerStream.SendMsg(m)
}
func _Eventing_ValidateEventSource_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(EventSource)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(EventingServer).ValidateEventSource(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/gateways.Eventing/ValidateEventSource",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(EventingServer).ValidateEventSource(ctx, req.(*EventSource))
}
return interceptor(ctx, in, info, handler)
}
var _Eventing_serviceDesc = grpc.ServiceDesc{
ServiceName: "gateways.Eventing",
HandlerType: (*EventingServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "ValidateEventSource",
Handler: _Eventing_ValidateEventSource_Handler,
},
},
Streams: []grpc.StreamDesc{
{
StreamName: "StartEventSource",
Handler: _Eventing_StartEventSource_Handler,
ServerStreams: true,
},
},
Metadata: "eventing.proto",
}
You can’t perform that action at this time.