configuration

package
v1.0.20 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ServerPort          string `json:"server_port"`
	Debug               bool   `json:"debug"`
	ResponseWorkerCount int64  `json:"response_worker_count"`
	MarshallerUrl       string `json:"marshaller_url"`
	DeviceManagerUrl    string `json:"device_manager_url"`
	DeviceRepositoryUrl string `json:"device_repository_url"`

	CacheExpiration                 string   `json:"cache_expiration"`
	CacheInvalidationAllKafkaTopics []string `json:"cache_invalidation_all_kafka_topics"`
	DeviceKafkaTopic                string   `json:"device_kafka_topic"`
	DeviceGroupKafkaTopic           string   `json:"device_group_kafka_topic"`

	TimescaleWrapperUrl string `json:"timescale_wrapper_url"`
	TimescaleImpl       string `json:"timescale_impl"` //"mgw" || "cloud" defaults to "cloud"

	KafkaUrl               string        `json:"kafka_url"`
	DefaultTimeout         string        `json:"default_timeout"`
	DefaultTimeoutDuration time.Duration `json:"-"`

	KafkaConsumerGroup string `json:"kafka_consumer_group"`
	ResponseTopic      string `json:"response_topic"`
	PermissionsUrl     string `json:"permissions_url"`
	GroupScheduler     string `json:"group_scheduler"`

	MetadataResponseTo string `json:"metadata_response_to"`

	AsyncFlushFrequency string `json:"async_flush_frequency"`
	AsyncCompression    string `json:"async_compression"`
	SyncCompression     string `json:"sync_compression"`
	Sync                bool   `json:"sync"`
	SyncIdempotent      bool   `json:"sync_idempotent"`
	PartitionNum        int64  `json:"partition_num"`
	ReplicationFactor   int64  `json:"replication_factor"`
	AsyncFlushMessages  int64  `json:"async_flush_messages"`

	KafkaConsumerMaxWait  string `json:"kafka_consumer_max_wait"`
	KafkaConsumerMinBytes int64  `json:"kafka_consumer_min_bytes"`
	KafkaConsumerMaxBytes int64  `json:"kafka_consumer_max_bytes"`

	MetadataErrorTo string `json:"metadata_error_to"`
	ErrorTopic      string `json:"error_topic"`

	TopicSuffixForScaling string `json:"topic_suffix_for_scaling"` //only for kafka & cloud

	KafkaTopicConfigs map[string][]kafka.ConfigEntry `json:"kafka_topic_configs"`

	MgwCorrelationIdPrefix string `json:"mgw_correlation_id_prefix"`
	MgwProtocolSegment     string `json:"mgw_protocol_segment"`
	MgwMqttBroker          string `json:"mgw_mqtt_broker"`
	MgwMqttClientId        string `json:"mgw_mqtt_client_id"`
	MgwMqttUser            string `json:"mgw_mqtt_user" config:"secret"`
	MgwMqttPw              string `json:"mgw_mqtt_pw" config:"secret"`
	ComImpl                string `json:"com_impl"`        //"mgw" || "cloud" defaults to "cloud"
	MarshallerImpl         string `json:"marshaller_impl"` //"mgw" || "cloud" defaults to "cloud"
	UseIotFallback         bool   `json:"use_iot_fallback"`
	IotFallbackFile        string `json:"iot_fallback_file"`

	MgwConceptRepoRefreshInterval int64 `json:"mgw_concept_repo_refresh_interval"` //in seconds

	OverwriteAuthToken       bool    `json:"overwrite_auth_token"`
	AuthExpirationTimeBuffer float64 `json:"auth_expiration_time_buffer"`
	AuthEndpoint             string  `json:"auth_endpoint"`
	AuthClientId             string  `json:"auth_client_id" config:"secret"`
	AuthUserName             string  `json:"auth_user_name" config:"secret"`
	AuthPassword             string  `json:"auth_password" config:"secret"`
	AuthFallbackToken        string  `json:"auth_fallback_token"`
}

func Load

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

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

Jump to

Keyboard shortcuts

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