configuration

package
v0.8.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseConfigurationFile

func ParseConfigurationFile(cmd *cobra.Command) (err error)

ParseConfigurationFile parses the configuration file starting from the command

Types

type CloudMapConfig

type CloudMapConfig struct {
	// Region where to look for
	Region string `yaml:"region,omitempty"`
	// CredentialsPath is the path where to find the AWS credentials.
	CredentialsPath string `yaml:"credentialsPath,omitempty"`
	// PollInterval is the number of seconds between two consecutive polls
	PollInterval int `yaml:"pollInterval,omitempty"`
}

CloudMapConfig contans data need to connect to AWS Cloud Map correctly.

type Config

type Config struct {
	// DebugMode specifies whether to log debug or not
	DebugMode bool `yaml:"debugMode,omitempty"`
	// Adaptor specifies the adaptor configuration
	Adaptor string `yaml:"adaptor,omitempty"`
	// MetadataKeys is the key to look for in a service's metadata
	MetadataKeys []string `yaml:"metadataKeys"`
	// ServiceRegistry settings about the service registry to use
	ServiceRegistry *ServiceRegistrySettings `yaml:"serviceRegistry"`
}

Config contains the configuration of the program

func GetConfigFile

func GetConfigFile() *Config

GetConfigFile returns the configuration file parsed with ParseConfigurationFile. If the configuration file was not provided via --conf, then this returns nil.

type ServiceDirectoryConfig

type ServiceDirectoryConfig struct {
	// PollingInterval is the number of seconds between two consecutive polls
	PollingInterval int `yaml:"pollInterval,omitempty"`
	// ProjectID is the name of the Google Cloud project
	ProjectID string `yaml:"projectID"`
	// Region where to look for
	Region string `yaml:"region"`
	// ServiceAccountPath is the path of the service account JSON
	ServiceAccountPath string `yaml:"serviceAccountPath"`
}

ServiceDirectoryConfig contains Service Directory configuration. Its fields are the same as the CLI flags, although the latter can override them.

type ServiceRegistrySettings

type ServiceRegistrySettings struct {
	// GCPServiceDirectory is the field with configuration about service
	// directory
	GCPServiceDirectory *ServiceDirectoryConfig `yaml:"gcpServiceDirectory,omitempty"`
	// AWSCloudMap contains configuration about AWS CloudMap
	AWSCloudMap *CloudMapConfig `yaml:"awsCloudMap,omitempty"`
}

ServiceRegistrySettings contains information

Jump to

Keyboard shortcuts

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