configuration

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2023 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Debug bool `json:"debug"`
	Mode  Mode `json:"mode"`

	MetricsPort string `json:"metrics_port"`

	ChannelSize        int `json:"channel_size"`
	ChannelWorkerCount int `json:"channel_worker_count"`

	MaxMessageAge string `json:"max_message_age"`

	AuthEndpoint             string  `json:"auth_endpoint"`
	AuthClientId             string  `json:"auth_client_id" config:"secret"`
	AuthExpirationTimeBuffer float64 `json:"auth_expiration_time_buffer"`

	DeviceRepoUrl           string `json:"device_repo_url"`
	DeviceRepoCacheDuration string `json:"device_repo_cache_duration"`

	NotificationUrl                            string `json:"notification_url"`
	NotificationsIgnoreDuplicatesWithinSeconds string `json:"notifications_ignore_duplicates_within_seconds"`

	EventTriggerUrl string `json:"event_trigger_url"` // Cloud: http://engine-wrapper-url:8080/v2/event-trigger or Fog: http://local-camunda-url:8080/engine-rest/message

	//fog
	MgwMqttPw       string `json:"mgw_mqtt_pw" config:"secret"`
	MgwMqttUser     string `json:"mgw_mqtt_user" config:"secret"`
	MgwMqttClientId string `json:"mgw_mqtt_client_id"`
	MgwMqttBroker   string `json:"mgw_mqtt_broker"`
	MgwMqttQos      byte   `json:"mgw_mqtt_qos"`

	MgwProcessSyncClientUrl string `json:"mgw_process_sync_client_url"`

	AuthUserName string `json:"auth_user_name"`
	AuthPassword string `json:"auth_password"`

	FallbackFile string `json:"fallback_file"`

	FogProtocol              interface{} `json:"fog_protocol"`
	FogProtocolDataFieldName string      `json:"fog_protocol_data_field_name"`

	//cloud
	KafkaUrl                            string              `json:"kafka_url"`
	KafkaConsumerGroup                  string              `json:"kafka_consumer_group"`
	DeviceTypeTopic                     string              `json:"device_type_topic"`
	ProcessDeploymentTopic              string              `json:"process_deployment_topic"`
	ProcessDeploymentDoneTopic          string              `json:"process_deployment_done_topic"`
	WatchedProcessDeploymentDoneHandler string              `json:"watched_process_deployment_done_handler"`
	KafkaTopicSliceCount                int                 `json:"kafka_topic_slice_count"`
	KafkaTopicSliceIndex                int                 `json:"kafka_topic_slice_index"`
	InstanceId                          string              `json:"instance_id"`
	ServiceTopicConfig                  []kafka.ConfigEntry `json:"service_topic_config"`

	CloudEventRepoCacheDuration       string `json:"cloud_event_repo_cache_duration"`
	CloudEventRepoMongoUrl            string `json:"cloud_event_repo_mongo_url"`
	CloudEventRepoMongoTable          string `json:"cloud_event_repo_mongo_table"`
	CloudEventRepoMongoDescCollection string `json:"cloud_event_repo_mongo_desc_collection"`

	AuthClientSecret string `json:"auth_client_secret" config:"secret"`

	DebugTraceKeys  []string `json:"debug_trace_keys"`
	DebugTraceIndex map[string]bool

	//all
	FatalErrHandler func(v ...interface{})
}

func Load

func Load(location string) (config Config, err error)

loads config from json in location and used environment variables (e.g KafkaUrl --> KAFKA_URL)

func (Config) HandleFatalError

func (this Config) HandleFatalError(v ...interface{})

func (Config) LogTrace

func (this Config) LogTrace(key string, values ...interface{})

type Mode

type Mode = string
var CloudMode Mode = "cloud"
var FogMode Mode = "fog"

Jump to

Keyboard shortcuts

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