configuration

package
v0.0.28 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Id = func() string {
	return uuid.NewString()
}
View Source
var LogEnvConfig = true
View Source
var TimeNow = time.Now

Functions

This section is empty.

Types

type Config

type Config struct {
	KafkaUrl                   string `json:"kafka_url"`
	KafkaConsumerGroup         string `json:"kafka_consumer_group"`
	ProcessDeploymentDoneTopic string `json:"process_deployment_done_topic"`
	DeviceGroupTopic           string `json:"device_group_topic"`

	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"`

	MongoUrl string `json:"mongo_url"`

	ApiPort                           string `json:"api_port"`
	MongoTable                        string `json:"mongo_table"`
	MongoWardenCollection             string `json:"mongo_warden_collection"`
	MongoDeploymentWardenCollection   string `json:"mongo_deployment_warden_collection"`
	MongoProcessDefinitionCollection  string `json:"mongo_process_definition_collection"`
	MongoDeploymentCollection         string `json:"mongo_deployment_collection"`
	MongoDeploymentMetadataCollection string `json:"mongo_deployment_metadata_collection"`
	MongoProcessHistoryCollection     string `json:"mongo_process_history_collection"`
	MongoIncidentCollection           string `json:"mongo_incident_collection"`
	MongoProcessInstanceCollection    string `json:"mongo_process_instance_collection"`
	MongoLastNetworkContactCollection string `json:"mongo_last_network_contact_collection"`
	PermissionsV2Url                  string `json:"permissions_v2_url"`
	DeviceRepoUrl                     string `json:"device_repo_url"`
	AnalyticsEnvelopePrefix           string `json:"analytics_envelope_prefix"`

	CleanupMaxAge   string `json:"cleanup_max_age"`
	CleanupInterval string `json:"cleanup_interval"`

	ApiDocsProviderBaseUrl string `json:"api_docs_provider_base_url"`

	DeveloperNotificationUrl string `json:"developer_notification_url"`

	InitTopics bool `json:"init_topics"`

	Mqtt             []MqttConfig `json:"mqtt"`
	MqttGroupId      string       `json:"mqtt_group_id"` //optional
	MqttCleanSession bool         `json:"mqtt_clean_session"`

	LogLevel             string `json:"log_level"`
	LoggerTrimFormat     string `json:"logger_trim_format"`
	LoggerTrimAttributes string `json:"logger_trim_attributes"`

	WardenInterval          string `json:"warden_interval"`
	WardenAgeGate           string `json:"warden_age_gate"`
	RunWardenDbLoop         bool   `json:"run_warden_db_loop"`
	RunWardenProcessLoop    bool   `json:"run_warden_process_loop"`
	RunWardenDeploymentLoop bool   `json:"run_warden_deployment_loop"`

	RunWardenMigration bool `json:"run_warden_migration"`
	// 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 ZookeeperUrl --> ZOOKEEPER_URL)

func (*Config) GetLogger added in v0.0.25

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

type MqttConfig added in v0.0.25

type MqttConfig struct {
	Broker   string `json:"broker"`
	ClientId string `json:"client_id" config:"secret"`
	User     string `json:"user" config:"secret"`
	Pw       string `json:"pw" config:"secret"`
}

Jump to

Keyboard shortcuts

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