generate

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2020 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package generate contains HTTP handler for triggering data generation into the databae.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHandler

func NewHandler(ctx context.Context, config *Config, env *serverenv.ServerEnv) (http.Handler, error)

Types

type Config

type Config struct {
	Database              database.Config
	SecretManager         secrets.Config
	ObservabilityExporter observability.Config

	Port                         string        `env:"PORT, default=8080"`
	NumExposures                 int           `env:"NUM_EXPOSURES_GENERATED, default=10"`
	KeysPerExposure              int           `env:"KEYS_PER_EXPOSURE, default=14"`
	MaxKeysOnPublish             uint          `env:"MAX_KEYS_ON_PUBLISH, default=15"`
	MaxSameStartIntervalKeys     uint          `env:"MAX_SAME_START_INTERVAL_KEYS, default=2"`
	SimulateSameDayRelease       bool          `env:"SIMULATE_SAME_DAY_RELEASE, default=false"`
	MaxIntervalAge               time.Duration `env:"MAX_INTERVAL_AGE_ON_PUBLISH, default=360h"`
	MaxMagnitudeSymptomOnsetDays uint          `env:"MAX_SYMPTOM_ONSET_DAYS, default=21"`
	CreatedAtTruncateWindow      time.Duration `env:"TRUNCATE_WINDOW, default=1h"`
	DefaultRegion                string        `env:"DEFAULT_REGION, default=US"`
	ChanceOfKeyRevision          int           `env:"CHANCE_OF_KEY_REVISION, default=30"` // 0-100 are valid values.
	ChanceOfTraveler             int           `env:"CHANCE_OF_TRAVELER, default=20"`     // 0-100 are valid values
	KeyRevisionDelay             time.Duration `env:"KEY_REVISION_DELAY, default=2h"`     // key revision will be forward dates this amount.
	UseDefaultSymptomOnset       bool          `env:"USE_DEFAULT_SYMPTOM_ONSET_DAYS, default=true"`
	SymptomOnsetDays             uint          `env:"DEFAULT_SYMPTOM_ONSET_DAYS, default=10"`
}

Config represents the configuration and associated environment variables for the publish components.

func (*Config) DatabaseConfig

func (c *Config) DatabaseConfig() *database.Config

func (*Config) DebugReleaseSameDayKeys

func (c *Config) DebugReleaseSameDayKeys() bool

func (*Config) DefaultSymptomOnsetDays added in v0.11.1

func (c *Config) DefaultSymptomOnsetDays() int32

func (*Config) MaxExposureKeys

func (c *Config) MaxExposureKeys() uint

func (*Config) MaxIntervalStartAge

func (c *Config) MaxIntervalStartAge() time.Duration

func (*Config) MaxSameDayKeys

func (c *Config) MaxSameDayKeys() uint

func (*Config) MaxSymptomOnsetDays

func (c *Config) MaxSymptomOnsetDays() uint

func (*Config) ObservabilityExporterConfig

func (c *Config) ObservabilityExporterConfig() *observability.Config

func (*Config) SecretManagerConfig

func (c *Config) SecretManagerConfig() *secrets.Config

func (*Config) TruncateWindow

func (c *Config) TruncateWindow() time.Duration

func (*Config) UseDefaultSymptomOnsetDays added in v0.11.1

func (c *Config) UseDefaultSymptomOnsetDays() bool

Jump to

Keyboard shortcuts

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