config

package
v1.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 18, 2026 License: MIT Imports: 2 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

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"`
	OnsDomain                  string        `envconfig:"ONS_DOMAIN"`
	FeedbackTo                 string        `envconfig:"FEEDBACK_TO"`
	FeedbackFrom               string        `envconfig:"FEEDBACK_FROM"`
	VersionPrefix              string        `envconfig:"VERSION_PREFIX"`
	Mail                       *Mail
	Sanitize                   *Sanitize
}

Config represents service configuration for dp-feedback-api

func Get

func Get() (*Config, error)

Get returns the default config with any modifications through environment variables

func (*Config) Validate

func (c *Config) Validate() error

type Mail

type Mail struct {
	Host      string `envconfig:"MAIL_HOST"`
	User      string `envconfig:"MAIL_USER"`
	Password  string `envconfig:"MAIL_PASSWORD" json:"-"`
	Port      string `envconfig:"MAIL_PORT"`
	Encrypted bool   `envconfig:"MAIL_ENCRYPTION"`
}

Mail represents the subset of configuration corresponding to the email service

type Sanitize

type Sanitize struct {
	HTML  bool `envconfig:"SANITIZE_HTML"`
	SQL   bool `envconfig:"SANITIZE_SQL"`
	NoSQL bool `envconfig:"SANITIZE_NO_SQL"`
}

Sanitize represents the subset of configuration corresponding to the input string sanitization

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL