11package config
22
3+ import "github.com/fiware/VCVerifier/logging"
4+
35// CONFIGURATION STRUCTURE FOR THE VERIFIER CONFIG
46
57// general structure of the configuration file
68type Configuration struct {
7- Server Server `mapstructure:"server"`
8- Verifier Verifier `mapstructure:"verifier"`
9- Logging Logging `mapstructure:"logging"`
10- ConfigRepo ConfigRepo `mapstructure:"configRepo"`
11- M2M M2M `mapstructure:"m2m"`
12- Elsi Elsi `mapstructure:"elsi"`
9+ Server Server `mapstructure:"server"`
10+ Verifier Verifier `mapstructure:"verifier"`
11+ Logging logging. LoggingConfig `mapstructure:"logging"`
12+ ConfigRepo ConfigRepo `mapstructure:"configRepo"`
13+ M2M M2M `mapstructure:"m2m"`
14+ Elsi Elsi `mapstructure:"elsi"`
1315}
1416
1517// general configuration to run the application
@@ -22,6 +24,15 @@ type Server struct {
2224 TemplateDir string `mapstructure:"templateDir" default:"views/"`
2325 // directory of static files to be provided, f.e. to be used inside the templates
2426 StaticDir string `mapstructure:"staticDir" default:"views/static/"`
27+
28+ // ReadTimeout is the maximum duration for reading the entire request, including the body.
29+ ReadTimeout int `mapstructure:"readTimeout" default:"5"`
30+ // WriteTimeout is the maximum duration before timing out writes of the response.
31+ WriteTimeout int `mapstructure:"writeTimeout" default:"10"`
32+ // IdleTimeout is the maximum amount of time to wait for the next request when keep-alives are enabled.
33+ IdleTimeout int `mapstructure:"idleTimeout" default:"120"`
34+ // ShutdownTimeout is the time allowed for active requests to finish during shutdown.
35+ ShutdownTimeout int `mapstructure:"shutdownTimeout" default:"5"`
2536}
2637
2738// configuration for M2M interaction
@@ -42,18 +53,6 @@ type M2M struct {
4253 KeyType string `mapstructure:"keyType" default:"RSAPS256"`
4354}
4455
45- // logging config
46- type Logging struct {
47- // loglevel to be used - can be DEBUG, INFO, WARN or ERROR
48- Level string `mapstructure:"level" default:"INFO"`
49- // should the logging in a structured json format
50- JsonLogging bool `mapstructure:"jsonLogging" default:"true"`
51- // should requests be logged
52- LogRequests bool `mapstructure:"logRequests" default:"true"`
53- // list of paths to be ignored on request logging(could be often called operational endpoints like f.e. metrics)
54- PathsToSkip []string `mapstructure:"pathsToSkip"`
55- }
56-
5756// configuration specific to the functionality of the verifier
5857type Verifier struct {
5958 // did to be used by the verifier
0 commit comments