config

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: Apache-2.0 Imports: 11 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 {
	ApiPort                      string   `json:"api_port"`
	KafkaUrl                     string   `json:"kafka_url"`
	DeviceRepoUrl                string   `json:"device_repo_url"`
	ProcessRepoUrl               string   `json:"process_repo_url"`
	PermSearchUrl                string   `json:"perm_search_url"`
	DeviceSelectionUrl           string   `json:"device_selection_url"`
	MongoUrl                     string   `json:"mongo_url"`
	MongoTable                   string   `json:"mongo_table"`
	MongoDeploymentCollection    string   `json:"mongo_deployment_collection"`
	MongoDependenciesCollection  string   `json:"mongo_dependencies_collection"`
	ConsumerGroup                string   `json:"consumer_group"`
	Debug                        bool     `json:"debug"`
	ConnectivityTest             bool     `json:"connectivity_test"`
	DeploymentTopic              string   `json:"deployment_topic"`
	UsersTopic                   string   `json:"users_topic"`
	NotificationUrl              string   `json:"notification_url"`
	ImportDeployUrl              string   `json:"import_deploy_url"`
	CacheInvalidationKafkaTopics []string `json:"cache_invalidation_kafka_topics"`

	EnableDeviceGroupsForTasks                bool `json:"enable_device_groups_for_tasks"`
	EnableDeviceGroupsForEvents               bool `json:"enable_device_groups_for_events"`
	EnableImportsForEvents                    bool `json:"enable_imports_for_events"`
	EnableModifiedDevicesForDeploymentOptions bool `json:"enable_modified_devices_for_deployment_options"`

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

Jump to

Keyboard shortcuts

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