@@ -11,6 +11,7 @@ type Config struct {
11
11
ClusterConfig * ClusterConfig `json:"clusterConfig" yaml:"clusterConfig" mapstructure:"clusterConfig"`
12
12
Integrations Integrations `json:"integrations" yaml:"integrations" mapstructure:"integrations"`
13
13
IntegrationHooks IntegrationHooks `json:"integrationsHooks" yaml:"integrationsHooks" mapstructure:"integrationsHooks"`
14
+ CacheConfig * CacheConfig `json:"cacheConfig" yaml:"cacheConfig" mapstructure:"cacheConfig"`
14
15
}
15
16
16
17
// ClusterConfig holds the cluster level configuration
@@ -119,10 +120,11 @@ type DatabaseSchema struct {
119
120
120
121
// DatabaseRule stores information of db rule
121
122
type DatabaseRule struct {
122
- Table string `json:"col,omitempty" yaml:"col" mapstructure:"col"`
123
- DbAlias string `json:"dbAlias,omitempty" yaml:"dbAlias" mapstructure:"dbAlias"`
124
- IsRealTimeEnabled bool `json:"isRealtimeEnabled,omitempty" yaml:"isRealtimeEnabled" mapstructure:"isRealtimeEnabled"`
125
- Rules map [string ]* Rule `json:"rules,omitempty" yaml:"rules" mapstructure:"rules"`
123
+ Table string `json:"col,omitempty" yaml:"col" mapstructure:"col"`
124
+ DbAlias string `json:"dbAlias,omitempty" yaml:"dbAlias" mapstructure:"dbAlias"`
125
+ IsRealTimeEnabled bool `json:"isRealtimeEnabled,omitempty" yaml:"isRealtimeEnabled" mapstructure:"isRealtimeEnabled"`
126
+ EnableCacheInvalidation bool `json:"enableCacheInvalidation,omitempty" yaml:"enableCacheInvalidation" mapstructure:"enableCacheInvalidation"`
127
+ Rules map [string ]* Rule `json:"rules,omitempty" yaml:"rules" mapstructure:"rules"`
126
128
}
127
129
128
130
// EventingConfig stores information of eventing config
@@ -150,6 +152,15 @@ type FileStoreConfig struct {
150
152
ForcePathStyle * bool `json:"forcePathStyle,omitempty" yaml:"forcePathStyle,omitempty" mapstructure:"forcePathStyle"`
151
153
}
152
154
155
+ // CacheConfig describes the config of the caching module
156
+ type CacheConfig struct {
157
+ Enabled bool `json:"enabled" yaml:"enabled" mapstructure:"enabled"`
158
+ Conn string `json:"conn" yaml:"conn" mapstructure:"conn"`
159
+
160
+ // Represents Time To Live in seconds, default value is 5 minutes (5 * 60 seconds) if not provided
161
+ DefaultTTL int `json:"defaultTTL" yaml:"defaultTTL" mapstructure:"defaultTTL"`
162
+ }
163
+
153
164
// Secret describes the a secret object
154
165
type Secret struct {
155
166
IsPrimary bool `json:"isPrimary" yaml:"isPrimary" mapstructure:"isPrimary"` // used by the frontend & backend to generate token out of multiple secrets
@@ -191,9 +202,6 @@ const (
191
202
// Admin holds the admin config
192
203
type Admin struct {
193
204
ClusterConfig * ClusterConfig `json:"clusterConfig" yaml:"clusterConfig" mapstructure:"clusterConfig"`
194
- LicenseKey string `json:"licenseKey" yaml:"licenseKey" mapstructure:"licenseKey"`
195
- LicenseValue string `json:"licenseValue" yaml:"licenseValue" mapstructure:"licenseValue"`
196
- License string `json:"license" yaml:"license" mapstructure:"license"`
197
205
Integrations Integrations `json:"integrations" yaml:"integrations" mapstructure:"integrations"`
198
206
}
199
207
@@ -273,6 +281,7 @@ type Rule struct {
273
281
Template TemplatingEngine `json:"template,omitempty" yaml:"template,omitempty" mapstructure:"template"`
274
282
ReqTmpl string `json:"requestTemplate,omitempty" yaml:"requestTemplate,omitempty" mapstructure:"requestTemplate"`
275
283
OpFormat string `json:"outputFormat,omitempty" yaml:"outputFormat,omitempty" mapstructure:"outputFormat"`
284
+ Cache * ReadCacheOptions `json:"cache,omitempty" yaml:"cache,omitempty" mapstructure:"cache"`
276
285
}
277
286
278
287
// Auths holds the mapping of the sign in method
@@ -309,18 +318,19 @@ type Endpoint struct {
309
318
// depending upon the payload format, the graphQL request that
310
319
// gets converted to http request will use that format as it's payload
311
320
// currently supported formats are application/json,multipart/form-data
312
- ReqPayloadFormat string `json:"requestPayloadFormat" yaml:"requestPayloadFormat" mapstructure:"requestPayloadFormat"`
313
- ReqTmpl string `json:"requestTemplate" yaml:"requestTemplate" mapstructure:"requestTemplate"`
314
- GraphTmpl string `json:"graphTemplate" yaml:"graphTemplate" mapstructure:"graphTemplate"`
315
- ResTmpl string `json:"responseTemplate" yaml:"responseTemplate" mapstructure:"responseTemplate"`
316
- OpFormat string `json:"outputFormat,omitempty" yaml:"outputFormat,omitempty" mapstructure:"outputFormat"`
317
- Token string `json:"token,omitempty" yaml:"token,omitempty" mapstructure:"token"`
318
- Claims string `json:"claims,omitempty" yaml:"claims,omitempty" mapstructure:"claims"`
319
- Method string `json:"method" yaml:"method" mapstructure:"method"`
320
- Path string `json:"path" yaml:"path" mapstructure:"path"`
321
- Rule * Rule `json:"rule,omitempty" yaml:"rule,omitempty" mapstructure:"rule"`
322
- Headers Headers `json:"headers,omitempty" yaml:"headers,omitempty" mapstructure:"headers"`
323
- Timeout int `json:"timeout,omitempty" yaml:"timeout,omitempty" mapstructure:"timeout"` // Timeout is in seconds
321
+ ReqPayloadFormat string `json:"requestPayloadFormat" yaml:"requestPayloadFormat" mapstructure:"requestPayloadFormat"`
322
+ ReqTmpl string `json:"requestTemplate" yaml:"requestTemplate" mapstructure:"requestTemplate"`
323
+ GraphTmpl string `json:"graphTemplate" yaml:"graphTemplate" mapstructure:"graphTemplate"`
324
+ ResTmpl string `json:"responseTemplate" yaml:"responseTemplate" mapstructure:"responseTemplate"`
325
+ OpFormat string `json:"outputFormat,omitempty" yaml:"outputFormat,omitempty" mapstructure:"outputFormat"`
326
+ Token string `json:"token,omitempty" yaml:"token,omitempty" mapstructure:"token"`
327
+ Claims string `json:"claims,omitempty" yaml:"claims,omitempty" mapstructure:"claims"`
328
+ Method string `json:"method" yaml:"method" mapstructure:"method"`
329
+ Path string `json:"path" yaml:"path" mapstructure:"path"`
330
+ Rule * Rule `json:"rule,omitempty" yaml:"rule,omitempty" mapstructure:"rule"`
331
+ Headers Headers `json:"headers,omitempty" yaml:"headers,omitempty" mapstructure:"headers"`
332
+ Timeout int `json:"timeout,omitempty" yaml:"timeout,omitempty" mapstructure:"timeout"` // Timeout is in seconds
333
+ CacheOptions []string `json:"cacheOptions" yaml:"cacheOptions" mapstructure:"cacheOptions"`
324
334
}
325
335
326
336
// EndpointKind describes the type of endpoint. Default value - internal
@@ -448,3 +458,9 @@ type LetsEncrypt struct {
448
458
ID string `json:"id,omitempty" yaml:"id,omitempty" mapstructure:"id"`
449
459
WhitelistedDomains []string `json:"domains" yaml:"domains" mapstructure:"domains"`
450
460
}
461
+
462
+ // ReadCacheOptions describes the cache options in requests
463
+ type ReadCacheOptions struct {
464
+ TTL int64 `json:"ttl" yaml:"ttl" mapstructure:"ttl"` // here ttl is represented in seconds
465
+ InstantInvalidate bool `json:"instantInvalidate" yaml:"instantInvalidate" mapstructure:"instantInvalidate"`
466
+ }
0 commit comments