configuration

package
v1.0.42 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2026 License: Apache-2.0 Imports: 12 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"`

	AsyncCacheRefresh bool `json:"async_cache_refresh"`

	CacheInvalidationKafkaTopics []string `json:"cache_invalidation_kafka_topics"`

	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" config:"secret"`
	AuthPassword string `json:"auth_password" config:"secret"`

	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"`
	ProcessDeploymentDoneTopic string              `json:"process_deployment_done_topic"`
	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

	ApiDocsProviderBaseUrl string `json:"api_docs_provider_base_url"`

	InitTopics bool `json:"init_topics"`

	DeviceTypeUpdateTriggerDelaySeconds int64 `json:"device_type_update_trigger_delay_seconds"`
	MinimumExpectedMessageCount         int   `json:"minimum_expected_message_count"`
	StatIndicatedErrorLimit             int   `json:"stat_indicated_error_limit"`

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

	LogLevel string `json:"log_level"`
	// contains filtered or unexported fields
}

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) GetLogger added in v1.0.38

func (this *Config) GetLogger() *slog.Logger

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