config

package
v0.0.0-...-ef1509a Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: Apache-2.0 Imports: 7 Imported by: 10

Documentation

Index

Constants

View Source
const (
	DefaultLockResourceKey = "routing_api_lock"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type APIConfig

type APIConfig struct {
	ListenPort  int  `yaml:"listen_port"`
	HTTPEnabled bool `yaml:"http_enabled"`

	MTLSListenPort     int    `yaml:"mtls_listen_port"`
	MTLSClientCAPath   string `yaml:"mtls_client_ca_file"`
	MTLSServerCertPath string `yaml:"mtls_server_cert_file"`
	MTLSServerKeyPath  string `yaml:"mtls_server_key_file"`
}

type Config

type Config struct {
	API                             APIConfig                 `yaml:"api"`
	AdminPort                       int                       `yaml:"admin_port"`
	DebugAddress                    string                    `yaml:"debug_address"`
	LogGuid                         string                    `yaml:"log_guid"`
	MetronConfig                    MetronConfig              `yaml:"metron_config"`
	MaxTTL                          time.Duration             `yaml:"max_ttl"`
	SystemDomain                    string                    `yaml:"system_domain"`
	MetricsReportingIntervalString  string                    `yaml:"metrics_reporting_interval"`
	MetricsReportingInterval        time.Duration             `yaml:"-"`
	StatsdEndpoint                  string                    `yaml:"statsd_endpoint"`
	StatsdClientFlushIntervalString string                    `yaml:"statsd_client_flush_interval"`
	StatsdClientFlushInterval       time.Duration             `yaml:"-"`
	OAuth                           OAuthConfig               `yaml:"oauth"`
	RouterGroups                    models.RouterGroups       `yaml:"router_groups"`
	ReservedSystemComponentPorts    []int                     `yaml:"reserved_system_component_ports"`
	FailOnRouterPortConflicts       bool                      `yaml:"fail_on_router_port_conflicts"`
	SqlDB                           SqlDB                     `yaml:"sqldb"`
	Locket                          locket.ClientLocketConfig `yaml:"locket"`
	UUID                            string                    `yaml:"uuid"`
	SkipSSLValidation               bool                      `yaml:"skip_ssl_validation"`
	LockTTL                         time.Duration             `yaml:"lock_ttl"`
	RetryInterval                   time.Duration             `yaml:"retry_interval"`
	LockResouceKey                  string                    `yaml:"lock_resource_key"`
}

func NewConfigFromBytes

func NewConfigFromBytes(bytes []byte, authDisabled bool) (Config, error)

func NewConfigFromFile

func NewConfigFromFile(configFile string, authDisabled bool) (Config, error)

type MetronConfig

type MetronConfig struct {
	Address string
	Port    string
}

type OAuthConfig

type OAuthConfig struct {
	TokenEndpoint     string `yaml:"token_endpoint"`
	Port              int    `yaml:"port"`
	SkipSSLValidation bool   `yaml:"-"`
	ClientName        string `yaml:"client_name"`
	ClientSecret      string `yaml:"client_secret"`
	CACerts           string `yaml:"ca_certs"`
}

type SqlDB

type SqlDB struct {
	Host                   string `yaml:"host"`
	Port                   int    `yaml:"port"`
	Schema                 string `yaml:"schema"`
	Type                   string `yaml:"type"`
	Username               string `yaml:"username"`
	Password               string `yaml:"password"`
	CACert                 string `yaml:"ca_cert"`
	SkipSSLValidation      bool   `yaml:"-"`
	SkipHostnameValidation bool   `yaml:"skip_hostname_validation"`
	MaxIdleConns           int    `yaml:"max_idle_connections"`
	MaxOpenConns           int    `yaml:"max_open_connections"`
	ConnMaxLifetime        int    `yaml:"connections_max_lifetime_seconds"`
}

Jump to

Keyboard shortcuts

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