Documentation
¶
Index ¶
- func Connect(backoff *wait.Backoff, conn func() error) error
- func HandleEventsFromEventSource(name string, eventStream Eventing_StartEventSourceServer, dataCh chan []byte, ...) error
- func Recover(eventSource string)
- func RegisterEventingServer(s *grpc.Server, srv EventingServer)
- func StartGateway(es EventingServer)
- type Event
- func (*Event) Descriptor() ([]byte, []int)
- func (m *Event) GetName() string
- func (m *Event) GetPayload() []byte
- func (*Event) ProtoMessage()
- func (m *Event) Reset()
- func (m *Event) String() string
- func (m *Event) XXX_DiscardUnknown()
- func (m *Event) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Event) XXX_Merge(src proto.Message)
- func (m *Event) XXX_Size() int
- func (m *Event) XXX_Unmarshal(b []byte) error
- type EventSource
- func (*EventSource) Descriptor() ([]byte, []int)
- func (m *EventSource) GetData() string
- func (m *EventSource) GetId() string
- func (m *EventSource) GetName() string
- func (m *EventSource) GetVersion() string
- func (*EventSource) ProtoMessage()
- func (m *EventSource) Reset()
- func (m *EventSource) String() string
- func (m *EventSource) XXX_DiscardUnknown()
- func (m *EventSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *EventSource) XXX_Merge(src proto.Message)
- func (m *EventSource) XXX_Size() int
- func (m *EventSource) XXX_Unmarshal(b []byte) error
- type EventSourceContext
- type EventSourceStatus
- type EventingClient
- type EventingServer
- type Eventing_StartEventSourceClient
- type Eventing_StartEventSourceServer
- type GatewayConfig
- func (gc *GatewayConfig) DispatchEvent(gatewayEvent *Event) error
- func (gc *GatewayConfig) UpdateGatewayResourceState(status *EventSourceStatus)
- func (gc *GatewayConfig) WatchGateway(ctx context.Context) (cache.Controller, error)
- func (gc *GatewayConfig) WatchGatewayEventSources(ctx context.Context) (cache.Controller, error)
- type GatewayEvent
- type TransformerPayload
- type UnimplementedEventingServer
- type ValidEventSource
- func (*ValidEventSource) Descriptor() ([]byte, []int)
- func (m *ValidEventSource) GetIsValid() bool
- func (m *ValidEventSource) GetReason() string
- func (*ValidEventSource) ProtoMessage()
- func (m *ValidEventSource) Reset()
- func (m *ValidEventSource) String() string
- func (m *ValidEventSource) XXX_DiscardUnknown()
- func (m *ValidEventSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ValidEventSource) XXX_Merge(src proto.Message)
- func (m *ValidEventSource) XXX_Size() int
- func (m *ValidEventSource) XXX_Unmarshal(b []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandleEventsFromEventSource ¶
func HandleEventsFromEventSource(name string, eventStream Eventing_StartEventSourceServer, dataCh chan []byte, errorCh chan error, doneCh chan struct{}, log *logrus.Logger) error
HandleEventsFromEventSource handles events from the event source.
func RegisterEventingServer ¶
func RegisterEventingServer(s *grpc.Server, srv EventingServer)
Types ¶
type 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:"-"`
}
* Represents an event
func (*Event) Descriptor ¶
func (*Event) GetPayload ¶
func (*Event) ProtoMessage ¶
func (*Event) ProtoMessage()
func (*Event) XXX_DiscardUnknown ¶
func (m *Event) XXX_DiscardUnknown()
func (*Event) XXX_Marshal ¶
func (*Event) XXX_Unmarshal ¶
type EventSource ¶
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:"-"`
}
* Represents an event source
func (*EventSource) Descriptor ¶
func (*EventSource) Descriptor() ([]byte, []int)
func (*EventSource) GetData ¶
func (m *EventSource) GetData() string
func (*EventSource) GetId ¶
func (m *EventSource) GetId() string
func (*EventSource) GetName ¶
func (m *EventSource) GetName() string
func (*EventSource) GetVersion ¶
func (m *EventSource) GetVersion() string
func (*EventSource) ProtoMessage ¶
func (*EventSource) ProtoMessage()
func (*EventSource) Reset ¶
func (m *EventSource) Reset()
func (*EventSource) String ¶
func (m *EventSource) String() string
func (*EventSource) XXX_DiscardUnknown ¶
func (m *EventSource) XXX_DiscardUnknown()
func (*EventSource) XXX_Marshal ¶
func (m *EventSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*EventSource) XXX_Merge ¶
func (m *EventSource) XXX_Merge(src proto.Message)
func (*EventSource) XXX_Size ¶
func (m *EventSource) XXX_Size() int
func (*EventSource) XXX_Unmarshal ¶
func (m *EventSource) XXX_Unmarshal(b []byte) error
type EventSourceContext ¶
type EventSourceContext struct {
// Source holds the actual event source
Source *EventSource
// Ctx contains context for the connection
Ctx context.Context
// Cancel upon invocation cancels the connection context
Cancel context.CancelFunc
// Client is grpc client
Client EventingClient
// Conn is grpc connection
Conn *grpc.ClientConn
}
EventSourceContext contains information of a event source for gateway to run.
type EventSourceStatus ¶
type EventSourceStatus struct {
// Id of the event source
Id string
// Name of the event source
Name string
// Message
Message string
// Phase of the event source
Phase v1alpha1.NodePhase
// Gateway reference
Gw *v1alpha1.Gateway
}
EventSourceStatus encapsulates state of an event source
type EventingClient ¶
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)
}
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.
func NewEventingClient ¶
func NewEventingClient(cc *grpc.ClientConn) EventingClient
type EventingServer ¶
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)
}
EventingServer is the server API for Eventing service.
type Eventing_StartEventSourceClient ¶
type Eventing_StartEventSourceClient interface {
Recv() (*Event, error)
grpc.ClientStream
}
type Eventing_StartEventSourceServer ¶
type Eventing_StartEventSourceServer interface {
Send(*Event) error
grpc.ServerStream
}
type GatewayConfig ¶
type GatewayConfig struct {
// Log provides fast and simple logger dedicated to JSON output
Log *logrus.Logger
// Clientset is client for kubernetes API
Clientset kubernetes.Interface
// Name is gateway name
Name string
// Namespace is namespace for the gateway to run inside
Namespace string
// KubeConfig rest client config
KubeConfig *rest.Config
// StatusCh is used to communicate the status of an event source
StatusCh chan EventSourceStatus
// contains filtered or unexported fields
}
GatewayConfig provides a generic event source for a gateway
func NewGatewayConfiguration ¶
func NewGatewayConfiguration() *GatewayConfig
NewGatewayConfiguration returns a new gateway configuration
func (*GatewayConfig) DispatchEvent ¶
func (gc *GatewayConfig) DispatchEvent(gatewayEvent *Event) error
DispatchEvent dispatches event to gateway transformer for further processing
func (*GatewayConfig) UpdateGatewayResourceState ¶
func (gc *GatewayConfig) UpdateGatewayResourceState(status *EventSourceStatus)
UpdateGatewayResourceState updates gateway resource nodes state
func (*GatewayConfig) WatchGateway ¶
func (gc *GatewayConfig) WatchGateway(ctx context.Context) (cache.Controller, error)
WatchGateway watches for changes in the gateway resource This will act as replacement for old gateway-transformer-configmap. Changes to watchers, event version and event type will be reflected.
func (*GatewayConfig) WatchGatewayEventSources ¶
func (gc *GatewayConfig) WatchGatewayEventSources(ctx context.Context) (cache.Controller, error)
WatchGatewayEventSources watches change in configuration for the gateway
type GatewayEvent ¶
type GatewayEvent struct {
// Src is source of event
Src string `json:"src"`
// Payload contains event data
Payload []byte `json:"payload"`
}
GatewayEvent is the internal representation of an event.
type TransformerPayload ¶
type TransformerPayload struct {
// Src contains information about which specific configuration in gateway generated the event
Src string `json:"src"`
// Payload is event data
Payload []byte `json:"payload"`
}
TransformerPayload contains payload of cloudevents.
type UnimplementedEventingServer ¶
type UnimplementedEventingServer struct {
}
UnimplementedEventingServer can be embedded to have forward compatible implementations.
func (*UnimplementedEventingServer) StartEventSource ¶
func (*UnimplementedEventingServer) StartEventSource(req *EventSource, srv Eventing_StartEventSourceServer) error
func (*UnimplementedEventingServer) ValidateEventSource ¶
func (*UnimplementedEventingServer) ValidateEventSource(ctx context.Context, req *EventSource) (*ValidEventSource, error)
type ValidEventSource ¶
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:"-"`
}
* Represents if an event source is valid or not
func (*ValidEventSource) Descriptor ¶
func (*ValidEventSource) Descriptor() ([]byte, []int)
func (*ValidEventSource) GetIsValid ¶
func (m *ValidEventSource) GetIsValid() bool
func (*ValidEventSource) GetReason ¶
func (m *ValidEventSource) GetReason() string
func (*ValidEventSource) ProtoMessage ¶
func (*ValidEventSource) ProtoMessage()
func (*ValidEventSource) Reset ¶
func (m *ValidEventSource) Reset()
func (*ValidEventSource) String ¶
func (m *ValidEventSource) String() string
func (*ValidEventSource) XXX_DiscardUnknown ¶
func (m *ValidEventSource) XXX_DiscardUnknown()
func (*ValidEventSource) XXX_Marshal ¶
func (m *ValidEventSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ValidEventSource) XXX_Merge ¶
func (m *ValidEventSource) XXX_Merge(src proto.Message)
func (*ValidEventSource) XXX_Size ¶
func (m *ValidEventSource) XXX_Size() int
func (*ValidEventSource) XXX_Unmarshal ¶
func (m *ValidEventSource) XXX_Unmarshal(b []byte) error
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package common contains structs and methods that are shared across different gateways.
|
Package common contains structs and methods that are shared across different gateways. |
|
community
|
|
|
aws-sns/cmd
command
|
|
|
aws-sqs/cmd
command
|
|
|
gcp-pubsub/cmd
command
|
|
|
github/cmd
command
|
|
|
gitlab/cmd
command
|
|
|
hdfs/cmd
command
|
|
|
slack/cmd
command
|
|
|
storagegrid/cmd
command
|
|
|
core
|
|
|
artifact/cmd
command
|
|
|
calendar/cmd
command
|
|
|
file/cmd
command
|
|
|
resource/cmd
command
|
|
|
stream/amqp/cmd
command
|
|
|
stream/kafka/cmd
command
|
|
|
stream/mqtt/cmd
command
|
|
|
stream/nats/cmd
command
|
|
|
webhook/cmd
command
|