config

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: May 12, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ENV_LOG_LEVEL      = "LOG_LEVEL"
	ENV_GIN_DEBUG_MODE = "GIN_DEBUG_MODE"

	ENV_RESEARCHER_BACKEND_LISTEN_PORT = "RESEARCHER_BACKEND_LISTEN_PORT"
	ENV_CORS_ALLOW_ORIGINS             = "CORS_ALLOW_ORIGINS"
	ENV_USE_DUMMY_LOGIN                = "USE_DUMMY_LOGIN"            // if true, test mode for auth is used
	ENV_LOGIN_SUCCESS_REDIRECT_URL     = "LOGIN_SUCCESS_REDIRECT_URL" // address of the web-application

	ENV_API_KEYS = "API_KEYS"

	ENV_SAML_IDP_URL                   = "SAML_IDP_URL"
	ENV_SAML_SERVICE_PROVIDER_ROOT_URL = "SAML_SERVICE_PROVIDER_ROOT_URL"
	ENV_SAML_ENTITY_ID                 = "SAML_ENTITY_ID"
	ENV_SAML_IDP_METADATA_URL          = "SAML_IDP_METADATA_URL"
	ENV_SAML_SESSION_CERT_PATH         = "SAML_SESSION_CERT_PATH"
	ENV_SAML_SESSION_KEY_PATH          = "SAML_SESSION_KEY_PATH"

	ENV_SAML_LOGIN_FAILED_REDIRECT_URL       = "SAML_LOGIN_FAILED_REDIRECT_URL"
	ENV_SAML_ATTRIBUTE_FOR_TEKENRADAR_ACCESS = "SAML_ATTRIBUTE_FOR_TEKENRADAR_ACCESS"
	ENV_RESEARCHADMIN_EMAILS                 = "RESEARCHADMIN_EMAILS"

	ENV_JWT_TOKEN_KEY = "JWT_TOKEN_KEY"

	ENV_RESEARCHER_DB_CONNECTION_STR    = "RESEARCHER_DB_CONNECTION_STR"
	ENV_RESEARCHER_DB_USERNAME          = "RESEARCHER_DB_USERNAME"
	ENV_RESEARCHER_DB_PASSWORD          = "RESEARCHER_DB_PASSWORD"
	ENV_RESEARCHER_DB_CONNECTION_PREFIX = "RESEARCHER_DB_CONNECTION_PREFIX"

	ENV_DB_TIMEOUT           = "DB_TIMEOUT"
	ENV_DB_IDLE_CONN_TIMEOUT = "DB_IDLE_CONN_TIMEOUT"
	ENV_DB_MAX_POOL_SIZE     = "DB_MAX_POOL_SIZE"
	ENV_DB_NAME_PREFIX       = "DB_DB_NAME_PREFIX"

	ENV_ADDR_STUDY_SERVICE        = "ADDR_STUDY_SERVICE"
	ENV_ADDR_EMAIL_CLIENT_SERVICE = "ADDR_EMAIL_CLIENT_SERVICE"
	ENV_GRPC_MAX_MSG_SIZE         = "GRPC_MAX_MSG_SIZE"
)
View Source
const (
	DefaultGRPCMaxMsgSize = 4194304
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Port                    string
	AllowOrigins            []string
	APIKeys                 []string
	LogLevel                logger.LogLevel
	GinDebugMode            bool
	SAMLConfig              *types.SAMLConfig `yaml:"saml_config"`
	UseDummyLogin           bool
	LoginSuccessRedirectURL string
	ResearcherDBConfig      types.DBConfig
	ServiceURLs             struct {
		StudyService string `yaml:"study_service"`
		EmailClient  string `yaml:"email_client_service"`
	}
	MaxMsgSize int
}

Config is the structure that holds all global configuration data

func InitConfig

func InitConfig() Config

Jump to

Keyboard shortcuts

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