config

package
v0.0.40 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2026 License: Apache-2.0 Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NewId = func() string {
	return uuid.NewString()
}

to replace when testing

View Source
var TimeNow = func() time.Time {
	return time.Now()
}

to replace time when testing

Functions

func HandleEnvironmentVars

func HandleEnvironmentVars(config Config)

preparations for docker

Types

type Config

type Config = *ConfigStruct

func LoadConfig

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

type ConfigStruct

type ConfigStruct struct {
	LogLevel         string `json:"log_level"`
	ApiPort          string `json:"api_port"`
	MetricsPort      string `json:"metrics_port"`
	KafkaUrl         string `json:"kafka_url"`
	ImportDeployUrl  string `json:"import_deploy_url"`
	ConsumerGroup    string `json:"consumer_group"`
	Debug            bool   `json:"debug"`
	DeploymentTopic  string `json:"deployment_topic"`
	ConnectivityTest bool   `json:"connectivity_test"`

	ConditionalEventRepoMongoUrl                   string `json:"conditional_event_repo_mongo_url"`
	ConditionalEventRepoMongoTable                 string `json:"conditional_event_repo_mongo_table"`
	ConditionalEventRepoMongoDescCollection        string `json:"conditional_event_repo_mongo_desc_collection"`
	ConditionalEventRepoMongoDeploymentsCollection string `json:"conditional_event_repo_mongo_deployments_collection"`

	ImportRepositoryUrl string `json:"import_repository_url"`

	DeviceRepositoryUrl string `json:"device_repository_url"`

	//if not configured: no device-group updates handled
	DeviceGroupTopic string `json:"device_group_topic"`

	//if not configured: no deployment done events are published
	DeploymentDoneTopic string `json:"deployment_done_topic"`

	//if not configured: events with groups not handled
	AuthExpirationTimeBuffer float64 `json:"auth_expiration_time_buffer"`
	AuthEndpoint             string  `json:"auth_endpoint"`
	AuthClientId             string  `json:"auth_client_id" config:"secret"`
	AuthClientSecret         string  `json:"auth_client_secret" config:"secret"`

	HttpClientTimeout     string `json:"http_client_timeout"`
	HttpServerTimeout     string `json:"http_server_timeout"`
	HttpServerReadTimeout string `json:"http_server_read_timeout"`

	UserTokenCacheLifespanInSec int64 `json:"user_token_cache_lifespan_in_sec"`

	DisableKafka                  bool `json:"disable_kafka"`
	DisableKafkaProcessDeployment bool `json:"disable_kafka_process_deployment"`
	DisableKafkaDeviceGroupUpdate bool `json:"disable_kafka_device_group_update"`
	DisableKafkaDoneProducer      bool `json:"disable_kafka_done_producer"`

	InitTopics bool `json:"init_topics"`
	// contains filtered or unexported fields
}

func (*ConfigStruct) GetLogger added in v0.0.40

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

Jump to

Keyboard shortcuts

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