-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathruntime_config.go
More file actions
46 lines (42 loc) · 1.12 KB
/
runtime_config.go
File metadata and controls
46 lines (42 loc) · 1.12 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// SPDX-License-Identifier: EUPL-1.2
package api
// RuntimeConfig captures the engine's current runtime-facing configuration in
// a single snapshot.
//
// It groups the existing Swagger, transport, GraphQL, cache, and i18n snapshots
// so callers can inspect the active engine surface without joining multiple
// method results themselves.
//
// Example:
//
// cfg := engine.RuntimeConfig()
type RuntimeConfig struct {
Swagger SwaggerConfig
Transport TransportConfig
GraphQL GraphQLConfig
Cache CacheConfig
I18n I18nConfig
Authentik AuthentikConfig
}
// RuntimeConfig returns a stable snapshot of the engine's current runtime
// configuration.
//
// The result clones the underlying snapshots so callers can safely retain or
// modify the returned value.
//
// Example:
//
// cfg := engine.RuntimeConfig()
func (e *Engine) RuntimeConfig() RuntimeConfig {
if e == nil {
return RuntimeConfig{}
}
return RuntimeConfig{
Swagger: e.SwaggerConfig(),
Transport: e.TransportConfig(),
GraphQL: e.GraphQLConfig(),
Cache: e.CacheConfig(),
I18n: e.I18nConfig(),
Authentik: e.AuthentikConfig(),
}
}