-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added navigation cache to the feedback controller
- Loading branch information
Allan Degnan
committed
Jan 27, 2023
1 parent
5485889
commit 5bee5b1
Showing
9 changed files
with
225 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1 @@ | ||
// assets in locale and templates folders are converted into Go source code with go-bindata | ||
// the data.go file in this package is auto generated through the generate-dev and generate-prod tasks in the Makefile | ||
package assets |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,20 +8,30 @@ import ( | |
|
||
// Config represents service configuration for dp-frontend-feedback-controller | ||
type Config struct { | ||
BindAddr string `envconfig:"BIND_ADDR"` | ||
GracefulShutdownTimeout time.Duration `envconfig:"GRACEFUL_SHUTDOWN_TIMEOUT"` | ||
HealthCheckInterval time.Duration `envconfig:"HEALTHCHECK_INTERVAL"` | ||
HealthCheckCriticalTimeout time.Duration `envconfig:"HEALTHCHECK_CRITICAL_TIMEOUT"` | ||
MailHost string `envconfig:"MAIL_HOST"` | ||
MailUser string `envconfig:"MAIL_USER"` | ||
MailPassword string `envconfig:"MAIL_PASSWORD" json:"-"` | ||
MailPort string `envconfig:"MAIL_PORT"` | ||
FeedbackTo string `envconfig:"FEEDBACK_TO"` | ||
FeedbackFrom string `envconfig:"FEEDBACK_FROM"` | ||
PatternLibraryAssetsPath string `envconfig:"PATTERN_LIBRARY_ASSETS_PATH"` | ||
SiteDomain string `envconfig:"SITE_DOMAIN"` | ||
Debug bool `envconfig:"DEBUG"` | ||
SupportedLanguages []string `envconfig:"SUPPORTED_LANGUAGES"` | ||
APIRouterURL string `envconfig:"API_ROUTER_URL"` | ||
BindAddr string `envconfig:"BIND_ADDR"` | ||
CacheCensusTopicUpdateInterval time.Duration `envconfig:"CACHE_CENSUS_TOPICS_UPDATE_INTERVAL"` | ||
CacheNavigationUpdateInterval time.Duration `envconfig:"CACHE_NAVIGATION_UPDATE_INTERVAL"` | ||
CacheUpdateInterval time.Duration `envconfig:"CACHE_UPDATE_INTERVAL"` | ||
CensusTopicID string `envconfig:"CENSUS_TOPIC_ID"` | ||
Debug bool `envconfig:"DEBUG"` | ||
EnableCensusTopicSubsection bool `envconfig:"ENABLE_CENSUS_TOPIC_SUBSECTION"` | ||
EnableNewNavBar bool `envconfig:"ENABLE_NEW_NAVBAR"` | ||
GracefulShutdownTimeout time.Duration `envconfig:"GRACEFUL_SHUTDOWN_TIMEOUT"` | ||
HealthCheckInterval time.Duration `envconfig:"HEALTHCHECK_INTERVAL"` | ||
HealthCheckCriticalTimeout time.Duration `envconfig:"HEALTHCHECK_CRITICAL_TIMEOUT"` | ||
MailHost string `envconfig:"MAIL_HOST"` | ||
MailUser string `envconfig:"MAIL_USER"` | ||
MailPassword string `envconfig:"MAIL_PASSWORD" json:"-"` | ||
MailPort string `envconfig:"MAIL_PORT"` | ||
FeedbackTo string `envconfig:"FEEDBACK_TO"` | ||
FeedbackFrom string `envconfig:"FEEDBACK_FROM"` | ||
IsPublishingMode bool `envconfig:"IS_PUBLISHING_MODE"` | ||
Languages string `envconfig:"LANGUAGES"` | ||
PatternLibraryAssetsPath string `envconfig:"PATTERN_LIBRARY_ASSETS_PATH"` | ||
ServiceAuthToken string `envconfig:"SERVICE_AUTH_TOKEN" json:"-"` | ||
SiteDomain string `envconfig:"SITE_DOMAIN"` | ||
SupportedLanguages []string `envconfig:"SUPPORTED_LANGUAGES"` | ||
} | ||
|
||
var cfg *Config | ||
|
@@ -48,19 +58,28 @@ func get() (*Config, error) { | |
} | ||
|
||
cfg := &Config{ | ||
BindAddr: "localhost:25200", | ||
GracefulShutdownTimeout: 5 * time.Second, | ||
HealthCheckInterval: 30 * time.Second, | ||
HealthCheckCriticalTimeout: 90 * time.Second, | ||
MailHost: "localhost", | ||
MailPort: "1025", | ||
MailUser: "", | ||
MailPassword: "", | ||
FeedbackTo: "[email protected]", | ||
FeedbackFrom: "[email protected]", | ||
SiteDomain: "localhost", | ||
Debug: false, | ||
SupportedLanguages: []string{"en", "cy"}, | ||
APIRouterURL: "http://localhost:23200/v1", | ||
BindAddr: "localhost:25200", | ||
CacheCensusTopicUpdateInterval: 1 * time.Minute, | ||
CacheNavigationUpdateInterval: 1 * time.Minute, | ||
CacheUpdateInterval: 10 * time.Second, | ||
CensusTopicID: "4445", | ||
Debug: false, | ||
EnableCensusTopicSubsection: false, | ||
EnableNewNavBar: false, | ||
GracefulShutdownTimeout: 5 * time.Second, | ||
HealthCheckInterval: 30 * time.Second, | ||
HealthCheckCriticalTimeout: 90 * time.Second, | ||
MailHost: "localhost", | ||
MailPort: "1025", | ||
MailUser: "", | ||
MailPassword: "", | ||
FeedbackTo: "[email protected]", | ||
FeedbackFrom: "[email protected]", | ||
IsPublishingMode: false, | ||
ServiceAuthToken: "", | ||
SiteDomain: "localhost", | ||
SupportedLanguages: []string{"en", "cy"}, | ||
} | ||
|
||
return cfg, envconfig.Process("", cfg) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.