config

package
v0.0.0-...-6cc63a5 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthorizationConfig

type AuthorizationConfig struct {
	Enabled bool
	URL     string
	Caching *InMemoryCacheConfig
}

AuthorizationConfig captures the config for MLP authz

type Config

type Config struct {
	OpenAPISpecsPath string `default:"."`
	Port             int    `default:"3000"`

	AllowedOrigins      []string `default:"*"`
	AuthorizationConfig *AuthorizationConfig
	DbConfig            *DatabaseConfig
	MLPConfig           *MLPConfig
	MessageQueueConfig  *common_mq_config.MessageQueueConfig
	SegmenterConfig     map[string]interface{}
	ValidationConfig    ValidationConfig
	DeploymentConfig    DeploymentConfig
	NewRelicConfig      newrelic.Config
	SentryConfig        sentry.Config
	XpUIConfig          *XpUIConfig
}

func Load

func Load(filepaths ...string) (*Config, error)

func (*Config) ListenAddress

func (c *Config) ListenAddress() string

ListenAddress returns the Management API app's port

type DatabaseConfig

type DatabaseConfig struct {
	Host           string `default:"localhost"`
	Port           int    `default:"5432"`
	User           string `default:"xp"`
	Password       string `default:"xp"`
	Database       string `default:"xp"`
	MigrationsPath string `default:"file://database/db-migrations"`

	ConnMaxIdleTime time.Duration `default:"0s"`
	ConnMaxLifetime time.Duration `default:"0s"`
	MaxIdleConns    int           `default:"0"`
	MaxOpenConns    int           `default:"0"`
}

DatabaseConfig captures the XP database config

type DeploymentConfig

type DeploymentConfig struct {
	EnvironmentType string `default:"local"`
}

DeploymentConfig captures the config related to the deployment of Management Service

type InMemoryCacheConfig

type InMemoryCacheConfig struct {
	Enabled                     bool
	KeyExpirySeconds            int `default:"600"`
	CacheCleanUpIntervalSeconds int `default:"900"`
}

type MLPConfig

type MLPConfig struct {
	URL string
}

MLPConfig captures the configuration used to connect to the MLP API server

type ValidationConfig

type ValidationConfig struct {
	ValidationUrlTimeoutSeconds int `default:"5"`
}

ValidationConfig captures the config related to the validation of schemas

type XpUIConfig

type XpUIConfig struct {
	// Optional. If configured, xp management service API will serve static files
	// of the xp-ui React app.
	AppDirectory string
	// Optional. Defines the relative path under which the app will be accessible.
	// This should match `homepage` value from the `package.json` file of the CRA app
	Homepage string `default:"/xp"`
}

XpUIConfig captures config related to serving XP UI files

Jump to

Keyboard shortcuts

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