config

package
v0.0.0-...-f0fd134 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsAcceptedStatusCode

func IsAcceptedStatusCode(statusCode int32, acceptedCodes []int32) bool

func MaskPGCredInURI

func MaskPGCredInURI(s string) string

Types

type CerealConfig

type CerealConfig struct {
	Target string `mapstructure:"target"`
}

type CfgmgmtConfig

type CfgmgmtConfig struct {
	Target string `mapstructure:"target"`
}

type ComplianceConfig

type ComplianceConfig struct {
	Target string `mapstructure:"target"`
}

type DataFeedConfig

type DataFeedConfig struct {
	ServiceConfig    ServiceConfig    `mapstructure:"service"`
	LogConfig        LogConfig        `mapstructure:"log"`
	TLSConfig        certs.TLSConfig  `mapstructure:"tls"`
	SecretsConfig    SecretsConfig    `mapstructure:"secrets"`
	CfgmgmtConfig    CfgmgmtConfig    `mapstructure:"cfgmgmt"`
	ComplianceConfig ComplianceConfig `mapstructure:"compliance"`
	CerealConfig     CerealConfig     `mapstructure:"cereal"`
	PostgresConfig   PostgresConfig   `mapstructure:"postgres"`
	ServiceCerts     *certs.ServiceCerts
}

Configuration for the Data Feed Service

func Configure

func Configure() (*DataFeedConfig, error)

Configure marshals configuration from the data-feed-service configuration file that has been read in by Viper during the root command's initConfig(). Settings are parsed by Viper into the DataFeedConfig struct.

func (*DataFeedConfig) GetCerts

func (c *DataFeedConfig) GetCerts() *certs.ServiceCerts

func (*DataFeedConfig) ListenAddress

func (c *DataFeedConfig) ListenAddress() string

ListenAddress is the address where gRPC server will bind and listen

func (*DataFeedConfig) SetLogLevel

func (c *DataFeedConfig) SetLogLevel()

SetLogLevel sets the log level for the service

type LogConfig

type LogConfig struct {
	LogLevel  string `mapstructure:"log_level"`
	LogFormat string `mapstructure:"log_format"`
}

type PostgresConfig

type PostgresConfig struct {
	ConnectionString string `mapstructure:"uri"`
	Database         string `mapstructure:"database"`
	MigrationsPath   string `mapstructure:"migrations_path"`
}

type SecretsConfig

type SecretsConfig struct {
	Target string `mapstructure:"target"`
}

type ServiceConfig

type ServiceConfig struct {
	Host                string        `mapstructure:"host"`
	Port                uint16        `mapstructure:"port"`
	FeedInterval        time.Duration `mapstructure:"feed_interval"`
	AssetPageSize       int32         `mapstructure:"asset_page_size"`
	ReportsPageSize     int32         `mapstructure:"reports_page_size"`
	NodeBatchSize       int           `mapstructure:"node_batch_size"`
	UpdatedNodesOnly    bool          `mapstructure:"updated_nodes_only"`
	DisableCIDRFilter   bool          `mapstructure:"disable_cidr_filter"`
	CIDRFilter          string        `mapstructure:"cidr_filter"`
	ExternalFqdn        string        `mapstructure:"external_fqdn"`
	AcceptedStatusCodes []int32       `mapstructure:"accepted_status_codes"`
	ContentType         string        `mapstructure:"content_type"`
}

Jump to

Keyboard shortcuts

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