saconfig

package
v2.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadConfiguration

func LoadConfiguration(path string, confType string) (interface{}, error)

LoadConfiguration loads and unmarshals configuration file by given path and type

Types

type AMQPConnection

type AMQPConnection struct {
	URL          string `json:"URL"`
	DataSource   string `json:"DataSource"`
	DataSourceID DataSource
}

AMQPConnection identifies single messagebus connection and expected format of incoming data.

type DataSource

type DataSource int

DataSource indentifies a format of incoming data in the message bus channel.

const (
	//DataSourceUniversal marks all types of data sorces which send data in smart-gateway universal format
	DataSourceUniversal DataSource = iota
	//DataSourceCollectd marks collectd as data source for metrics and(or) events
	DataSourceCollectd
	//DataSourceCeilometer marks Ceilometer as data source for metrics and(or) events
	DataSourceCeilometer
)

func (*DataSource) SetFromString

func (src *DataSource) SetFromString(name string) bool

SetFromString resets value according to given human readable identification. Returns false if invalid identification was given.

func (DataSource) String

func (src DataSource) String() string

String returns human readable data type identification.

type EventAPIConfig

type EventAPIConfig struct {
	APIEndpointURL  string `json:"APIEndpointURL"`  //API endpoint
	AMQP1PublishURL string `json:"AMQP1PublishURL"` // new amqp address to send notifications
}

EventAPIConfig ...

type EventConfiguration

type EventConfiguration struct {
	Debug               bool             `json:"Debug"`
	AMQP1EventURL       string           `json:"AMQP1EventURL"`
	AMQP1Connections    []AMQPConnection `json:"AMQP1Connections"`
	ElasticHostURL      string           `json:"ElasticHostURL"`
	UseBasicAuth        bool             `json:"UseBasicAuth"`
	ElasticUser         string           `json:"ElasticUser"`
	ElasticPass         string           `json:"ElasticPass"`
	API                 EventAPIConfig   `json:"API"`
	AlertManagerURL     string           `json:"AlertManagerURL"`
	AlertManagerEnabled bool             `json:"AlertManagerEnabled"`
	APIEnabled          bool             `json:"APIEnabled"`
	PublishEventEnabled bool             `json:"PublishEventEnabled"`
	ResetIndex          bool             `json:"ResetIndex"`
	Prefetch            int              `json:"Prefetch"`
	UniqueName          string           `json:"UniqueName"`
	ServiceType         string           `json:"ServiceType"`
	IgnoreString        string           `json:"-"` //TODO(mmagr): ?
	UseTLS              bool             `json:"UseTls"`
	TLSServerName       string           `json:"TlsServerName"`
	TLSClientCert       string           `json:"TlsClientCert"`
	TLSClientKey        string           `json:"TlsClientKey"`
	TLSCaCert           string           `json:"TlsCaCert"`
}

EventConfiguration ...

type MetricConfiguration

type MetricConfiguration struct {
	Debug            bool             `json:"Debug"`
	AMQP1MetricURL   string           `json:"AMQP1MetricURL"`
	AMQP1Connections []AMQPConnection `json:"AMQP1Connections"`
	CPUStats         bool             `json:"CPUStats"`
	Exporterhost     string           `json:"Exporterhost"`
	Exporterport     int              `json:"Exporterport"`
	Prefetch         int              `json:"Prefetch"`
	DataCount        int              `json:"DataCount"` //-1 for ever which is default //TODO(mmagr): config implementation does not have a way to for default value, implement one?
	UseTimeStamp     bool             `json:"UseTimeStamp"`
	UniqueName       string           `json:"UniqueName"`
	ServiceType      string           `json:"ServiceType"`
	IgnoreString     string           `json:"-"` //TODO(mmagr): ?
}

MetricConfiguration ...

Jump to

Keyboard shortcuts

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