config

package
v0.0.0-...-e6f4ba9 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2019 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const TechnicalEndpointBodyMaxSize = 8 * 1024

TechnicalEndpointBodyMaxSize for /configuration/validate endpoint

View Source
const TechnicalEndpointHeaderContentType = "application/yaml"

TechnicalEndpointHeaderContentType for /configuration/validate endpoint

Variables

This section is empty.

Functions

func NoEmptyValuesInSliceValidator

func NoEmptyValuesInSliceValidator(v interface{}, param string) error

NoEmptyValuesInSliceValidator for strings in slice

func RequestHeaderContentTypeValidator

func RequestHeaderContentTypeValidator(req http.Request, requiredContentType string) int

RequestHeaderContentTypeValidator for Content-Type header in request

func UniqueValuesInSliceValidator

func UniqueValuesInSliceValidator(v interface{}, param string) error

UniqueValuesInSliceValidator for strings in slice

func ValidateConf

func ValidateConf(conf YamlConfig, enableLogicalValidator bool) (bool, map[string][]error)

ValidateConf validate configuration from YAML file

func ValidateConfigurationHTTPHandler

func ValidateConfigurationHTTPHandler(w http.ResponseWriter, r *http.Request)

ValidateConfigurationHTTPHandler is used in technical HTTP endpoint for config file validation

Types

type Config

type Config struct {
	YamlConfig
}

Config contains processed YamlConfig data

func Configure

func Configure(configFilePath string) (conf Config, err error)

Configure parse configuration file

type YamlConfig

type YamlConfig struct {
	Service          httphandler.Service                `yaml:"Service"`
	Storages         storages.StoragesMap               `yaml:"Storages"`
	Shards           storages.ShardsMap                 `yaml:"Shards"`
	ShardingPolicies confregions.ShardingPolicies       `yaml:"ShardingPolicies"`
	CredentialsStore crdstoreconfig.CredentialsStoreMap `yaml:"CredentialsStore"`
	Logging          logconfig.LoggingConfig            `yaml:"Logging"`
	Metrics          metrics.Config                     `yaml:"Metrics"`
}

YamlConfig contains configuration fields of config file

func (*YamlConfig) ListenPortsLogicalValidator

func (c *YamlConfig) ListenPortsLogicalValidator() (valid bool, validationErrors map[string][]error)

ListenPortsLogicalValidator make sure that listen port and technical listen port are not equal

func (*YamlConfig) RegionsEntryLogicalValidator

func (c *YamlConfig) RegionsEntryLogicalValidator() (valid bool, validationErrors map[string][]error)

RegionsEntryLogicalValidator checks the correctness of "Regions" part of configuration file

func (*YamlConfig) TransportsEntryLogicalValidator

func (c *YamlConfig) TransportsEntryLogicalValidator() (valid bool, validationErrors map[string][]error)

TransportsEntryLogicalValidator checks the correctness of "Transports" part of configuration file

Jump to

Keyboard shortcuts

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