|
| 1 | +package v1alpha1 |
| 2 | + |
| 3 | +import ( |
| 4 | + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" |
| 5 | +) |
| 6 | + |
| 7 | +// +genclient |
| 8 | +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object |
| 9 | + |
| 10 | +// FabricEventStream defines FabricEventStream Custom Resource Definition Object. |
| 11 | +type FabricEventStream struct { |
| 12 | + metav1.TypeMeta `json:",inline"` |
| 13 | + metav1.ObjectMeta `json:"metadata,omitempty"` |
| 14 | + |
| 15 | + Spec FabricEventStreamSpec `json:"spec"` |
| 16 | +} |
| 17 | + |
| 18 | +// FabricEventStreamSpec defines the specification for the FabricEventStream TPR. |
| 19 | +type FabricEventStreamSpec struct { |
| 20 | + ApplicationId string `json:"applicationId"` |
| 21 | + EventStreams []EventStream `json:"eventStreams"` |
| 22 | +} |
| 23 | + |
| 24 | +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object |
| 25 | + |
| 26 | +// FabricEventStreamList defines a list of FabricEventStreams . |
| 27 | +type FabricEventStreamList struct { |
| 28 | + metav1.TypeMeta `json:",inline"` |
| 29 | + metav1.ListMeta `json:"metadata"` |
| 30 | + |
| 31 | + Items []FabricEventStream `json:"items"` |
| 32 | +} |
| 33 | + |
| 34 | +// EventStream defines the source, flow and sink of the event stream |
| 35 | +type EventStream struct { |
| 36 | + EventStreamFlow EventStreamFlow `json:"flow"` |
| 37 | + EventStreamSink EventStreamSink `json:"sink"` |
| 38 | + EventStreamSource EventStreamSource `json:"source"` |
| 39 | +} |
| 40 | + |
| 41 | +// EventStreamFlow defines the flow characteristics of the event stream |
| 42 | +type EventStreamFlow struct { |
| 43 | + Type string `json:"type"` |
| 44 | + DataTypeColumn string `json:"dataTypeColumn,omitempty"` |
| 45 | + DataOpColumn string `json:"dataOpColumn,omitempty"` |
| 46 | + MetadataColumn string `json:"metadataColumn,omitempty"` |
| 47 | + DataColumn string `json:"dataColumn,omitempty"` |
| 48 | + CallHomeIdColumn string `json:"callHomeIdColumn,omitempty"` |
| 49 | + CallHomeUrl string `json:"callHomeUrl,omitempty"` |
| 50 | +} |
| 51 | + |
| 52 | +// EventStreamSink defines the target of the event stream |
| 53 | +type EventStreamSink struct { |
| 54 | + Type string `json:"type"` |
| 55 | + EventType string `json:"eventType,omitempty"` |
| 56 | + MaxBatchSize uint32 `json:"maxBatchSize,omitempty"` |
| 57 | + QueueName string `json:"queueName,omitempty"` |
| 58 | +} |
| 59 | + |
| 60 | +// EventStreamSource defines the source of the event stream and connection for FES operator |
| 61 | +type EventStreamSource struct { |
| 62 | + Type string `json:"type"` |
| 63 | + Schema string `json:"schema,omitempty" defaults:"public"` |
| 64 | + EventStreamTable EventStreamTable `json:"table"` |
| 65 | + Filter string `json:"filter,omitempty"` |
| 66 | + Connection Connection `json:"jdbcConnection"` |
| 67 | +} |
| 68 | + |
| 69 | +// EventStreamTable defines the name and ID column to be used for streaming |
| 70 | +type EventStreamTable struct { |
| 71 | + Name string `json:"name"` |
| 72 | + IDColumn string `json:"idColumn,omitempty" defaults:"id"` |
| 73 | +} |
| 74 | + |
| 75 | +// Connection to be used for allowing the FES operator to connect to a database |
| 76 | +type Connection struct { |
| 77 | + Url string `json:"jdbcUrl"` |
| 78 | + SlotName string `json:"slotName"` |
| 79 | + DBAuth DBAuth `json:"databaseAuthentication"` |
| 80 | +} |
| 81 | + |
| 82 | +// DBAuth specifies the credentials to be used for connecting with the database |
| 83 | +type DBAuth struct { |
| 84 | + Type string `json:"type"` |
| 85 | + Name string `json:"name,omitempty"` |
| 86 | + UserKey string `json:"userKey,omitempty"` |
| 87 | + PasswordKey string `json:"passwordKey,omitempty"` |
| 88 | +} |
0 commit comments