config

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2023 License: MIT Imports: 2 Imported by: 0

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"`
}

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