-
Notifications
You must be signed in to change notification settings - Fork 31
/
db.go
29 lines (23 loc) · 1.11 KB
/
db.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package v1alpha1
import corev1 "k8s.io/api/core/v1"
type Database struct {
// +kubebuilder:default=default
Driver string `json:"driver,omitempty" protobuf:"bytes,1,opt,name=driver"`
DataSource *DBDataSource `json:"dataSource,omitempty" protobuf:"bytes,2,opt,name=dataSource"`
}
type DBDataSource struct {
Value string `json:"value,omitempty" protobuf:"bytes,1,opt,name=value"`
ValueFrom *DBDataSourceFrom `json:"valueFrom,omitempty" protobuf:"bytes,2,opt,name=valueFrom"`
}
type DBDataSourceFrom struct {
SecretKeyRef *corev1.SecretKeySelector `json:"secretKeyRef,omitempty" protobuf:"bytes,1,opt,name=secretKeyRef"`
}
type SQLStatement struct {
SQL string `json:"sql,omitempty" protobuf:"bytes,1,opt,name=sql"`
Args []string `json:"args,omitempty" protobuf:"bytes,2,rep,name=args"`
}
type SQLAction struct {
SQLStatement `json:",inline" protobuf:"bytes,1,opt,name=statement"`
OnRecordNotFound *SQLStatement `json:"onRecordNotFound,omitempty" protobuf:"bytes,2,opt,name=onRecordNotFound"`
OnError *SQLStatement `json:"onError,omitempty" protobuf:"bytes,3,opt,name=onError"`
}