config

package
v0.0.0-...-cc99bfc Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2020 License: GPL-3.0, GPL-3.0-or-later Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIService

type APIService struct {
	// RemoteEndpoint contains the endpoint used to connect to the APIService
	RemoteEndpoint string
	// BindIP contains the bind ip
	BindIP string
	// Port contains the port of the internal http server
	Port uint16
	// LogHTTPRequest enable the logging of the internal http serverl
	LogHTTPRequest bool
	// ReadOnly disable modifing APIs
	ReadOnly bool
	// EnableInsertingCustomPatchingFunction enable the API for inserting custom patching functions
	EnableInsertingCustomPatchingFunction bool
	// DebugOracleDatabaseAgreementsAssignmentAlgorithm enable the debugging of the Oracle/Database agreements assignment algorithm
	DebugOracleDatabaseAgreementsAssignmentAlgorithm bool
	// AuthenticationProvider contains info about how the users are authenticated
	AuthenticationProvider AuthenticationProviderConfig
	// OperatingSystemAggregationRules contains rules used to aggregate various operating systems
	OperatingSystemAggregationRules []AggregationRule
	// DefaultDatabaseTags contains the default list of database tags
	DefaultDatabaseTags []string
}

APIService contains configuration about the api service

type AggregationRule

type AggregationRule struct {
	// Regex contains the regular expression used for matching the aggregation group
	Regex string
	// Group contains the name of the group
	Group string
	// Product contains vendor/name of the operating system
	Product string
}

AggregationRule contains a rule used to aggregate string per group

type AlertService

type AlertService struct {
	// RemoteEndpoint contains the endpoint used to connect to the AlertService
	RemoteEndpoint string
	// BindIP contains the bind ip
	BindIP string
	// Port contains the port of the internal http server
	Port uint16
	// LogHTTPRequest enable the logging of the internal http serverl
	LogHTTPRequest bool
	// LogHTTPRequest enable the logging of the received messages
	LogMessages bool
	// LogThrows enable the logging of alert throws
	LogAlertThrows bool
	// PublisherUsername contains the username of the agent
	PublisherUsername string
	// PublisherPassword contains the password of the agent
	PublisherPassword string
	// QueueBufferSize contains the size of the buffer of the queue
	QueueBufferSize int
	// FreshnessCheckJob contains the parameters of the freshness check
	FreshnessCheckJob FreshnessCheckJob
	// Emailer contains the settings about the emailer
	Emailer Emailer
}

AlertService contains configuration about the alert service

type ArchivedHostCleaningJob

type ArchivedHostCleaningJob struct {
	// Crontab contains the crontab string used to schedule the cleaning
	Crontab string
	// DaysThreshold contains the threshdold of the archived host cleaning
	HourThreshold int
	// RunAtStartup contains true if the job should run when the service start, otherwise false
	RunAtStartup bool
}

ArchivedHostCleaningJob contains parameters for the archived host cleaning

type AuthenticationProviderConfig

type AuthenticationProviderConfig struct {
	// Type contains the type of the source. Supported types are:
	//	- basic
	// 	- ldap
	Type string
	// Username is the username of the user if type == "basic"
	Username string
	// Password is the password of the user if type == "basic"
	Password string
	// PrivateKey is the filename of the key
	PrivateKey string
	// PublicKey is the filename of the key
	PublicKey string
	// TokenValidityTimeout contains the number of seconds in which the token is still valid
	TokenValidityTimeout int
	Host                 string
	Port                 int
	LDAPBase             string
	LDAPUseSSL           bool
	LDAPBindDN           string
	LDAPBindPassword     string
	LDAPUserFilter       string
	LDAPGroupFilter      string
}

AuthenticationProviderConfig contains the settings used to authenticate the users

type ChartService

type ChartService struct {
	// RemoteEndpoint contains the endpoint used to connect to the ChartService
	RemoteEndpoint string
	// BindIP contains the bind ip
	BindIP string
	// Port contains the port of the internal http server
	Port uint16
	// LogHTTPRequest enable the logging of the internal http serverl
	LogHTTPRequest bool
}

ChartService contains configuration about the chart service

type Configuration

type Configuration struct {
	// DataService contains configuration about the data service
	DataService DataService
	// DataService contains configuration about the alert service
	AlertService AlertService
	// APIService contains configuration about the api service
	APIService APIService
	// RepoService contains configuration about the repo service
	RepoService RepoService
	// ChartService contains configuration about the chart service
	ChartService ChartService
	// Mongodb contains configuration about database connection, some data logic and migration
	Mongodb Mongodb
	// Version contains the version of the server
	Version string
	// ResourceFilePath contains the directory of the resources
	ResourceFilePath string
}

Configuration contains Ercole DataService configuration

func ReadConfig

func ReadConfig(log *logrus.Logger, extraConfigFile string) (configuration Configuration)

ReadConfig read, parse and return a Configuration from the configuration file

type CurrentHostCleaningJob

type CurrentHostCleaningJob struct {
	// Crontab contains the crontab string used to schedule the cleaning
	Crontab string
	// DaysThreshold contains the threshdold of the current host cleaning
	HourThreshold int
	// RunAtStartup contains true if the job should run when the service start, otherwise false
	RunAtStartup bool
}

CurrentHostCleaningJob contains parameters for the current host cleaning

type DataService

type DataService struct {
	// RemoteEndpoint contains the endpoint used to connect to the DataService
	RemoteEndpoint string
	// BindIP contains the bind ip
	BindIP string
	// Port contains the port of the internal http server
	Port uint16
	// LogHTTPRequest enable the logging of the internal http serverl
	LogHTTPRequest bool
	// LogInsertingHostdata enable the logging of the inserting hostdata
	LogInsertingHostdata bool
	// LogDataPatching enable the logging of the data patching
	LogDataPatching bool
	// EnablePatching enable the patching of the arrived hostdata
	EnablePatching bool
	// AgentUsername contains the username of the agent
	AgentUsername string
	// AgentPassword contains the password of the agent
	AgentPassword string
	// CurrentHostCleaningJob contains the parameters of the current host cleaning
	CurrentHostCleaningJob CurrentHostCleaningJob
	// ArchivedCleaningJob contains the parameters of the archived host cleaning
	ArchivedHostCleaningJob ArchivedHostCleaningJob
}

DataService contains configuration about the data service

type Emailer

type Emailer struct {
	// Enabled contains true if the emailer is enabled, otherwise false
	Enabled bool
	// From contains the source email
	From string
	// To contains the destinations
	To []string
	// SMTPServer contains the address or hostname of the server
	SMTPServer string
	// SMTPPort contains the port of the server
	SMTPPort int
	// SMTPUsername contains the username used to connect to the server
	SMTPUsername string
	// SMTPPassword contains the password used to connect to the server
	SMTPPassword string
	// DisableSSLCertificateValidation contains true if disable the certification validation, otherwise false
	DisableSSLCertificateValidation bool
}

Emailer contains settings used to send emails

type FreshnessCheckJob

type FreshnessCheckJob struct {
	// Crontab contains the crontab string used to schedule the freshness check
	Crontab string
	// DaysThreshold contains the threshdold of the freshness check
	DaysThreshold int
	// RunAtStartup contains true if the job should run when the service start, otherwise false
	RunAtStartup bool
}

FreshnessCheckJob contains parameters for the freshness check

type HTTPRepoService

type HTTPRepoService struct {
	// Enable contains true it the service is enabled, otherwise false
	Enable bool
	// RemoteEndpoint contains the endpoint used to connect to the HTTPRepoService
	RemoteEndpoint string
	// BindIP contains the bind ip
	BindIP string
	// Port contains the port of the internal http server
	Port uint16
	// LogHTTPRequest enable the logging of the internal http serverl
	LogHTTPRequest bool
}

HTTPRepoService contains parameters for a single serving service

type Mongodb

type Mongodb struct {
	// URI contains MongoDB connection string/URI like 'mongodb://localhost:27017/ercole'
	URI string
	// DBName contains the name of the database
	DBName string
	// Migrate is true when mongodb should update/migrate data/schema during the initializazion
	Migrate bool
}

Mongodb contains configuration about the database connection, some data logic and migration

type RepoService

type RepoService struct {
	// UpstreamRepository contains the list of upstream repositories
	UpstreamRepositories []UpstreamRepository
	// DistributedFiles contains the path to the files to be served
	DistributedFiles string
	// HTTP contains the configuration about the HTTP server
	HTTP HTTPRepoService
	// SFTP contains the configuration about the SFTP server
	SFTP SFTPRepoService
}

RepoService contains configuration about the repo service

type SFTPRepoService

type SFTPRepoService struct {
	// Enable contains true it the service is enabled, otherwise false
	Enable bool
	// RemoteEndpoint contains the endpoint used to connect to the SFTPRepoService
	RemoteEndpoint string
	// BindIP contains the bind ip
	BindIP string
	// Port contains the port of the sftp server
	Port uint16
	// PrivateKey contains the path to the private key
	PrivateKey string
	// LogConnections contains true if log connections, otherwise false
	LogConnections bool
	// DebugConnections contains true if debug connections, otherwise false
	DebugConnections bool
}

SFTPRepoService contains parameters for a single serving service

type UpstreamRepository

type UpstreamRepository struct {
	// Name of the repository
	Name string
	// Type of the repository
	// Supported types are:
	//		- github-release
	//		- directory
	//		- ercole-reposervice
	Type string
	// URL of the repository where to find files
	URL string
}

UpstreamRepository contains info about a upstream repository

Jump to

Keyboard shortcuts

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